Building a Strategy

Users can develop a variety of strategies using the platform's no-code strategy builder.

Getting Started

To build a strategy, head to https://www.tradegen.io/build_strategy after connecting your Celo wallet.

The strategy builder consists of the following fields:

  • Name: the name of your strategy (limited to 30 characters)

  • Description: brief description of your strategy (limited to 300 characters)

  • Max trade duration: maximum number of oracle rounds before the position is liquidated

  • Profit target: % above entry price at which the position is liquidated

  • Stop loss: % below entry price at which the position is liquidated

  • Direction: whether to go long or short on the underlying asset if entry conditions are met

  • Underlying asset: symbol of the asset to trade on Ubeswap

Adding Entry Conditions and Exit Conditions

After filling out the form fields, add some entry and exit conditions to finish building your strategy. At the time of writing, users are limited to 7 entry/exit conditions.

Clicking the 'plus' icon next to 'Entry Conditions' or 'Exit Conditions' will make the following modal appear:

Users can select from a variety of indicators and comparators to make the entry/exit condition. Depending on which indicator a user selects, a field will pop up asking for the indicator's parameter. Different comparators and second indicators are available depending on the first indicator chosen.

Entry/exit conditions follow a generalized pattern of comparing the value of one indicator to the value of another indicator.

Building The Strategy

To finish building the strategy, click the 'Build' button at the bottom of the form. Make sure to fill out all form fields and add at least 1 entry condition. Exit conditions are optional, since the max trade duration and profit target/stop loss ensure trades eventually get exited.

After building a strategy, users can run a backtest on the strategy to see how the strategy would have performed in the past. This can help gauge future profitability, but past performance can't guarantee future results.

Strategy data is stored on a centralized server until the strategy's developer is ready to publish the strategy on the platform. If the strategy gets approved through the community approval system, the strategy data is published on-chain, an on-chain trading bot is generated, and the strategy's developer will receive all transaction fees for the strategy whenever users invest in the strategy.

Available Indicators and Comparators

Users are given several default indicators and comparators they can use for free. These indicators/comparators are based on the latest price of a price feed update. Additional indicators and comparators can be purchased on the marketplace.

Once Chainlink adds support for Celo, Tradegen will connect a crypto API to Chainlink. This will greatly increase the number of possible indicators/comparators that users can add to the platform.

Users are given the following default indicators:

  • Down: Used as a placeholder when checking if the latest price update is lower than the previous. This indicator is meant to be used as a second indicator. Comparators compatible with this indicator check for the indicator's name, instead of the value.

  • EMA: Exponential moving average. This indicator can be used as either the first indicator or second indicator, and uses a parameter that represents the EMA period. Its value represents the time-weighted average of closing prices over the given period.

  • High of last N price updates: Returns the highest closing price recorded over the last N price updates. This indicator is meant to be used as a second indicator.

  • Interval: Represents a price interval, such as increments of $1 or $1000. This indicator should be used as a second indicator.

  • Latest price: The most recent price from a price feed update.

  • Low of last N price updates: Returns the lowest closing price recorded over the last N price updates. This indicator is meant to be used as a second indicator.

  • N percent: A constant that's meant to be used with comparators that measure price movement. This should be used as a second indicator. Returns N.

  • Nth price update: Returns the price recorded (N - 1) price feed updates prior to the latest price update. Setting N=1 returns the latest price. This indicator can be used as either first indicator or second indicator.

  • Previous N price updates: Returns an array of last N price updates, including the latest price. Setting N=1 returns a 1-element array with the latest price. This can be either first indicator or second indicator. Comparators using this indicator return true if each price update in the array meets the comparator condition.

  • SMA: Simple moving average. This indicator can be used as either the first indicator or second indicator, and its parameter represents the SMA period. Its value represents the sum of prices over the period divided by the period.

  • Up: Used as a placeholder when checking if the latest price update is higher than the previous. This indicator is meant to be used as a second indicator. Comparators compatible with this indicator check for the indicator's name, instead of the value.

Users are given the following default comparators:

  • Closes: Used for comparing the first indicator's current value to its previous value. Compatible second indicators are 'Down' and 'Up'. When used with 'Previous N price updates' as the first indicator, returns true if either all N price updates close down or all N price updates close up.

  • Crosses above: Returns true if the first indicator's previous value is below the second indicator's previous value and the first indicator's current value is above the second indicator's current value.

  • Crosses below: Returns true if the first indicator's previous value is above the second indicator's previous value and the first indicator's current value is below the second indicator's current value.

  • Fall by at least: Compatible with 'N percent' as second indicator. When used with 'Previous N price updates' as first indicator, returns true if the latest price is at least N percent below the first price. Otherwise, returns true if the first indicator's current value is at least N percent lower than its previous value.

  • Fall by at most: Compatible with 'N percent' as second indicator. When used with 'Previous N price updates' as first indicator, returns true if the latest price is at most N percent below the first price. Otherwise, returns true if the first indicator's current value is at most N percent lower than its previous value.

  • Falls to: Returns true if the first indicator's previous value is above the second indicator's previous value and the first indicator's current value is within +/- 0.1% of the second indicator's current value.

  • Is above: When used with 'Previous N price updates', returns true if each price update (i) is above the second indicator's value at index (i) in it's history. Otherwise, returns true if the first indicator's current value is above the second indicator's current value.

  • Is below: When used with 'Previous N price updates', returns true if each price update (i) is below the second indicator's value at index (i) in it's history. Otherwise, returns true if the first indicator's current value is below the second indicator's current value.

  • Rise by at least: Compatible with 'N percent' as second indicator. When used with 'Previous N price updates' as first indicator, returns true if the latest price is at least N percent above the first price. Otherwise, returns true if the first indicator's current value is at least N percent above than its previous value.

  • Rise by at most: Compatible with 'N percent' as second indicator. When used with 'Previous N price updates' as first indicator, returns true if the latest price is at most N percent above the first price. Otherwise, returns true if the first indicator's current value is at most N percent above than its previous value.

  • Rises to: Returns true if the first indicator's previous value is below the second indicator's previous value and the first indicator's current value is within +/- 0.1% of the second indicator's current value.

Last updated