Skip to main content

TSSL (futures)

Price trailing sets a range for buying and selling and follows price movement to identify entry or exit points. This can help avoid trading while prices are still trending in the same direction.

To implement price trailing with Gunbot, set a percentage-based trailing range that triggers the bot to begin monitoring prices. Once the threshold is met, Gunbot tracks prices and adjusts its buy/sell orders accordingly.

How to work with this strategy

Gunbot opens one position, either long or short, and closes it when the target is reached. If the stop is hit before a profitable close, Gunbot places a stop order at a loss. After closing a position, Gunbot looks to open a new long or short position. Gunbot does not add to existing open positions.

info

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

TSSL futures strategy long position trailing buy trigger visualization

Opening a long position is allowed when buy trailing finishes below LONG_LEVEL.

Sell method conditions

TSSL futures strategy short position trailing sell trigger visualization

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 account.

Conditions to stop

A position is closed at loss when negative ROE reaches the STOP_LIMIT target.

Strategy settings for TSSL (futures)

Long settings

LabelConfig ParameterDefault ValueDetailed Description
Buy enabledBUY_ENABLEDtrueEnables or disables buy (long) orders. When set to true, buy orders are allowed.
Long levelLONG_LEVEL1Determines the percentage distance from the Exponential Moving Average (EMA) at which long orders can be placed.
Buy rangeBUY_RANGE0.3Defines the buy trailing range as a percentage. This is the trailing distance for buy orders following the price down before placing a buy.

Short settings

LabelConfig ParameterDefault ValueDetailed Description
Sell enabledSELL_ENABLEDtrueEnables or disables sell (short) orders. When enabled, sell orders can be placed.
Short levelSHORT_LEVEL1The percentage distance from the EMA where short orders are allowed. This sets the threshold for entering short positions relative to the EMA.
Sell rangeSELL_RANGE0.3Sets the sell range as a percentage, defining how much the price should move up before initiating a trailing sell order.

Indicators

LabelConfig ParameterDefault ValueDetailed Description
PeriodPERIOD15Defines the timeframe of the candlesticks used in indicator calculations, in minutes. Ensure the value is supported by your exchange.
Medium EMAEMA116Specifies the number of candles used to calculate the medium Exponential Moving Average (EMA).
Fast EMAEMA28Adjusts the number of candles used to calculate a faster, more responsive EMA.
Mean reversionMEAN_REVERSIONtrueUses the mean reversion variant for your selected buy and sell methods, to trade price returns to a mean value.