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.
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.
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
- Description
- Values
- Order types
- Name
Set this to false to prevent Gunbot from opening long positions.
Values: true or false
Default value: true
Affects | Does not affect |
---|---|
Strategy buy | Strategy sell |
DCA buy | Stop limit |
RT buy | Close |
RT buyback | RT sell |
Parameter name in config.js
: BUY_ENABLED
Long Level
- Description
- Values
- Order types
- Name
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.
Values: numerical – represent a percentage.
Default value: 1
Affects | Does not affect |
---|---|
Strategy buy | RT buy |
RT buyback | |
RT sell | |
Close | |
Stop limit | |
Strategy sell | |
DCA buy |
Parameter name in config.js
: LONG_LEVEL
Buy Range
- Description
- Values
- Order types
- Name
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.
Values: numerical, represents a percentage.
Default value: 0.5
Affects | Does not affect |
---|---|
Strategy buy | Strategy sell |
Stop limit | |
Close | |
RT sell | |
DCA buy | |
RT buy | |
RT buyback |
Parameter name in config.js
: BUY_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
- Description
- Values
- Order types
- Name
Set this to false to prevent Gunbot from opening short positions.
Values: true or false
Default value: true
Affects | Does not affect |
---|---|
Strategy buy | Strategy sell |
DCA buy | Stop limit |
RT buy | Close |
RT buyback | RT sell |
Parameter name in config.js
: SELL_ENABLED
Short Level
- Description
- Values
- Order types
- Name
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.
Values: numerical – represent a percentage.
Default value: 1
Affects | Does not affect |
---|---|
Strategy sell | RT buy |
RT buyback | |
RT sell | |
Close | |
Stop limit | |
Strategy buy | |
DCA buy |
Parameter name in config.js
: SHORT_LEVEL
Sell Range
- Description
- Values
- Order types
- Name
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.
Values: numerical – represents a percentage.
Default value: 0.5
Affects | Does not affect |
---|---|
Strategy sell | Strategy buy |
RT buy | |
RT buyback | |
RT sell | |
Close | |
DCA buy | |
Stop limit | |
Parameter name in config.js
: SELL_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
- Description
- Values
- Order types
- Name
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.
Values: numerical– represents candlestick size in minutes.
Default value: 15
Affects | Does not affect |
---|---|
Strategy sell | RT buy |
Strategy buy | RT buyback |
RT sell | |
Close | |
Stop limit | |
DCA buy |
Parameter name in config.js
: PERIOD
Slow EMA
- Description
- Values
- Order types
- Name
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).
Values: numerical – represents a number of candlesticks.
Default value: 16
Affects | Does not affect |
---|---|
Strategy buy | RT buy |
RT buyback | |
RT sell | |
Close | |
Stop limit | |
Strategy sell | |
DCA buy |
Parameter name in config.js
: EMA1
Medium EMA
- Description
- Values
- Order types
- Name
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).
Values: numerical – represents a number of candlesticks.
Default value: 8
Affects | Does not affect |
---|---|
Strategy buy | RT buy |
RT buyback | |
RT sell | |
Close | |
Stop limit | |
Strategy sell | |
DCA buy |
Parameter name in config.js
: EMA2