TSSL (futures)
Price trailing is a useful method that involves setting a customizable range for buying and selling, then following prices as they move up or down to identify optimal entry or exit points. By doing this, you can avoid trading while prices are still trending in the same direction.
To implement price trailing with Gunbot, you'll first need to establish your preferred trailing range. This will typically involve setting a percentage-based threshold that triggers the bot to begin monitoring prices for potential trades. Once the threshold is met, Gunbot will actively track prices and adjust its buy/sell orders accordingly to maximize returns.
One of the primary benefits of price trailing is that it allows for more flexible trading strategies that can adapt to changing market conditions.
How to work with this strategy​
Gunbot will open one position, either long or short, and close this position when the target is reached. When the stop is hit before profitably closing a trade, Gunbot will place a stop order at loss. After closing a position, Gunbot will again look to open a new long or short position. Gunbot will not add to existing open positions.
Using tssl
(futures) is only meaningful with MEAN_REVERSION
enabled.
The info below assumes you have set this.
The examples below show how the basic triggers for tssl
work. Additionally, you can use confirming indicators and settings like ROE trailing.
Buy method conditions​
Opening a long position is allowed when buy trailing finishes below LONG_LEVEL
.
Sell method conditions​
Opening a short position is allowed when sell trailing finishes above SHORT_LEVEL
.
Conditions to close​
Position is closed when the desired ROE
(return on equity) is reached. This is a percentage from the entry point, taking leverage into consideration.
Conditions to stop​
A position is closed at loss when negative ROE
reaches the STOP_LIMIT
target.
Strategy settings for TSSL (futures)​
Long settings​
Label | Config Parameter | Default Value | Detailed Description |
---|---|---|---|
Buy enabled | BUY_ENABLED | true | This setting enables you to allow or disallow buy (long) orders in your trading strategy. When set to true, buy orders are allowed. |
Long level | LONG_LEVEL | 1 | This parameter determines the percentage distance from the Exponential Moving Average (EMA) at which long orders can be placed. Set this to specify how far away from the EMA your entry point should be. |
Buy range | BUY_RANGE | 0.3 | This setting defines the buy range for trailing. It is expressed as a percentage that specifies the trailing distance for buy orders following the price down before placing a buy. |
Short settings​
Label | Config Parameter | Default Value | Detailed Description |
---|---|---|---|
Sell enabled | SELL_ENABLED | true | This setting allows you to enable or disable sell (short) orders within your strategy. When enabled, it permits the placement of sell orders. |
Short level | SHORT_LEVEL | 1 | The short level is the percentage distance from the EMA where short orders are allowed. This setting helps determine the threshold for entering short positions relative to the EMA. |
Sell range | SELL_RANGE | 0.3 | Sets the sell range as a percentage, defining how much the price should move up before initiating a trailing sell order. This helps in capitalizing on price increases before a sell order is executed. |
Indicators​
Label | Config Parameter | Default Value | Detailed Description |
---|---|---|---|
Period | PERIOD | 15 | The period defines the timeframe of the candlesticks used in the calculation of indicators, specified in minutes. Ensure that the value you select is supported by your exchange. |
Medium EMA | EMA1 | 16 | This setting specifies the number of candles used to calculate the medium Exponential Moving Average (EMA), providing a balance between responsiveness and smoothing of price movements. |
Fast EMA | EMA2 | 8 | The fast EMA setting adjusts the number of candles used to calculate a faster, more responsive EMA, suitable for identifying earlier signals in a fast-moving market. |
Mean reversion | MEAN_REVERSION | true | Enabling this option uses the mean reversion variant for your selected buy and sell methods, adapting your strategy to capitalize on price returns to a mean value. |