Average True Range Trailing Stop

The Average True Range (ATR) is an indicator that measures volatility. This strategy uses ATR to calculate trailing stops to provide buy and sell signals when volatility increases or decreases and crosses the trailing stop.

Using the configurable ATRX multiplier for ATR, a lower and upper limit are calculated.

  • The lower limit, called ATR short, is calculated by substracting the result of ATRX from next rounds bid.
  • The upper limit, called ATR long, is calculated by adding the result of ATRX to next rounds ask.

A buy order is placed when the ask price crosses up ATR long.

A sell order is placed when the bid price crosses under ATR short and price is above the break-even point.

As ATR does not provide information about price direction, it is strongly recommended to use an additional momentum indicator like RSI.

Trading example

atrts

Example of how trading with this strategy can perform. Details and settings

Strategy parameters

Following settings options are available for ATRTS and can be set in the strategy configurator of the GUI or the strategies section of the config.js file.

These settings are global and apply to all pairs running this strategy. When you want a specific parameter to be different for one or more pairs, use an override at the pair level.

Using the BUY_METHOD and SELL_METHOD parameters you can combine different methods for buying and selling. This strategy page assumes both BUY_METHOD and SELL_METHOD are set to ATRTS. Accepted values are all strategy names as listed here.

Buy settings

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

ParameterDefault valueDescription
BUY_ENABLEDtrueValues: true or false.
Setting this to false prevents Gunbot from placing buy orders. Affects all types of buy orders.This will not prevent reversal trading from completing its cycle. As soon as reversal trading completes and the final profitable sale is made, regular buy orders will be prevented.
TAKE_BUYfalseValues: true or false.
With this setting enabled, Gunbot will try to take any buy chance between the strategy entry point and your setting for TBUY_RANGE.As soon as the ask price drops below the upper border of this range (called “Take Buy”), it will trail down with a range of TBUY_RANGE and place a buy order as soon as the ask price crosses up “Take Buy”. Confirming indicators in use are respected.Normal strategy buy orders are still possible while using TAKE_BUY.This option should not be used together with reversal trading.
TBUY_RANGE0.5Values: numerical – represents a percentage.
This sets the buy range for TAKE_BUY.When set to 0.5, the initial trailing stop is set 0.5% above the entry point defined by BUY_LEVEL.
BUY_LEVEL1Values: numerical – represent a percentage.
This sets entry point for TAKE_BUY at a percentage below the lowest EMA.When you set this to 1, the entry point will be set 1% below the currently lowest EMA.

Sell settings

Sell settings are the primary trigger for sell orders. These parameters control the execution of sell orders when using ATRTS as sell method.

ParameterDefault valueDescription
SELL_ENABLEDtrueValues: true or false.
Set this to false to prevent Gunbot from placing sell orders. Affects all types of sell orders.
TAKE_PROFITfalseValues: true or false.
With this setting enabled, Gunbot will try to take any possible profit between the break-even point and your strategy exit point. This can be useful, for example, on days where the markets move very slowly.It works by trailing prices upwards between the break-even point and the strategy exit point, with a configurable range for trailing: TP_RANGE. A sell order will be placed when the trailing stop limit is hit or strategy sell conditions are reached. Confirming indicators in use are respected.Sells at minimal loss are possible when using TAKE_PROFIT, acting as a sort of mini stop loss.This option should not be used together with reversal trading and DOUBLE_CHECK_GAIN
TP_RANGE0.5Values: numerical – represents a percentage.
This sets the sell range for TAKE_PROFIT.When set to 0.5, the initial trailing stop is set 0.5% below the break-even point.
TP_PROFIT_ONLYfalseValues: true or false.
Enable this to only allow sell orders above the break-even point.
DOUBLE_CHECK_GAINtrueValues: true or false.
Disable this to allow sell orders below the break-even point.
GAIN0.5Values: numerical – represents a percentage.
This sets the minimum target for selling when DOUBLE_CHECK_GAIN is enabled.

Balance settings

Go to balance settings

Indicator settings

Relevant indicators for trading with ATRTS

These settings have a direct effect on trading with ATRTS.

ParameterDefault valueDescription
PERIOD15Values: numerical– represents candlestick size in minutes.
This sets the candlestick period used for trading, this affects all indicators within the strategy. Only use supported values.Setting a short period allows you to trade on shorter trends, but be aware that these will be noisier than longer periods.
ATRX0.5Values: numerical – represents a multiplier for ATR.
This value defines the multiplier used for calculation of the lower and upper limits for trading with ATRTSWhen set to 5, ATR gets multiplied by 5 and the result gets subtracted from next rounds bid & added to next rounds ask to set the limits.
ATR_PERIOD14Values: numerical, represents a number of periods.
The number of periods used for calculating ATR.

Confirming indicators + advanced indicator settings

Go to confirming indicators

Dollar cost avg settings

Go to Dollar cost avg (DCA)

Reversal trading settings

Go to reversal trading

TrailMe settings

Parameters to configure additional trailing for various types of orders. Trailing works just like it does for the TSSL strategy, the difference being the starting point of trailing.

Orders resulting from trailing are only placed when the main strategy criteria are met, and confirming indicators (if any) allow the order. All these conditions must occur in the same cycle.

Because this strategy already trails, it is not recommended to use additional price trailing for normal buy and sell orders. Trades will only happen when both the trailing stop and strategy stop happen in the same round.

Go to Trailme

Misc settings

Go to misc settings

Placeholders

The following parameters in config.js have no function for this strategy and act as placeholder.

ParameterDescription
BUYLVL1Placeholder.
BUYLVL2Placeholder.
BUYLVL3Placeholder.
BUYLVLPlaceholder.
BUY_RANGEPlaceholder.
DISPLACEMENTPlaceholder.
FAST_SMAPlaceholder.
GAINPlaceholder.
HIGH_BBPlaceholder.
KIJUN_CLOSEPlaceholder.
KIJUN_PERIODPlaceholder.
KIJUN_STOPPlaceholder.
KUMO_CLOSEPlaceholder.
KUMO_SENTIMENTSPlaceholder.
KUMO_STOPPlaceholder.
LEVERAGEPlaceholder.
LONG_LEVELPlaceholder.
LOW_BBPlaceholder.
MACD_LONGPlaceholder.
MACD_SHORTPlaceholder.
MACD_SIGNALPlaceholder.
MAKER_FEESPlaceholder.
MEAN_REVERSIONPlaceholder.
PP_BUYPlaceholder.
PP_SELLPlaceholder.
PRE_ORDER_GAPPlaceholder.
PRE_ORDERPlaceholder.
RENKO_ATRPlaceholder.
RENKO_BRICK_SIZEPlaceholder.
RENKO_PERIODPlaceholder.
ROE_CLOSEPlaceholder.
ROE_LIMITPlaceholder.
ROE_TRAILINGPlaceholder.
ROEPlaceholder.
SELLLVL1Placeholder.
SELLLVL2Placeholder.
SELLLVL3Placeholder.
SELLLVLPlaceholder.
SELL_RANGEPlaceholder.
SENKOUSPAN_PERIODPlaceholder.
SHORT_LEVELPlaceholder.
SLOW_SMAPlaceholder.
TENKAN_CLOSEPlaceholder.
TENKAN_PERIODPlaceholder.
TENKAN_STOPPlaceholder.
TSSL_TARGET_ONLYPlaceholder.
USE_RENKOPlaceholder.