Skip to main content

TSSL

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.

info

Using tssl (futures) is only meaningful with MEAN_REVERSIONenabled.

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.

Long settings

Buy settings are the primary trigger for long orders. These parameters control the execution of long orders when using smacross as buy method.

Buy enabled

Set this to false to prevent Gunbot from opening long positions.


Long Level

This sets the target for opening a long position at a percentage above the highest EMA.

When you set this to 1, buy orders will only be placed when the current price is at least 1% above the currently highest EMA.


Buy Range

This sets the buy range for trailing.

Setting a range of 0.5% at a starting price of 0.1 would set a range between 0.0995 and 0.1005.

As long as prices keep moving downwards, the range moves down along with the price. As soon as prices start going upward, the range freezes and a buy order is placed when the price crosses the upper boundary of the range.


Short settings

Buy settings are the primary trigger for short orders. These parameters control the execution of short orders when using smacross as sell method.

Sell enabled

Set this to false to prevent Gunbot from opening short positions.


Short Level

This sets the target for opening a short position at a percentage below the lowest EMA.

When you set this to 1, sell orders will only be placed when the current price is at least 1% below the currently lowest EMA.


Sell Range

This sets the sell range for trailing. Setting a range of 0.5% at a starting price of 0.1 would set a range between 0.0995 and 0.1005.

As long as prices keep moving upwards, the range moves up along with the price. As soon as prices start going downward, the range freezes and a sell order is placed when the prices crosses the lower boundary of the range.


Indicator settings

Relevant indicators for trading with tssl.

These settings have a direct effect on trading with tssl, this is where you configure how Bollinger Bands are calculated and at which distance from them orders should be placed. Additionally, long and short level are dependent on EMA.

Period

This sets the candlestick period used for trading, this affects all indicators within the strategy.

Only use supported values. The trading settings editor suggests valid values for the selected exchange..

Setting a short period allows you to trade on shorter trends, but be aware that these will be noisier than longer periods.


Slow EMA

Set this to the amount of candlesticks you want to use for your slow EMA. The closing price for each candle is used in the slow EMA calculation.

For example: when you set PERIOD to 5, and want to use 2h for slow EMA – you need to set EMA1 to 24 (24 * 5 mins).


Medium EMA

Set this to the amount of candlesticks you want to use for your medium EMA. The closing price for each candle is used in the fast EMA calculation.

For example: when you set PERIOD to 5, and want to use 1h for medium EMA – you need to set EMA2 to 12 (12 * 5 mins).