Skip to main content

ATRTS

The Average True Range (ATR) indicator measures volatility in the price of a security. It was developed by J. Welles Wilder Jr. and introduced in his 1978 book, "New Concepts in Technical Trading Systems." The ATR calculation takes into account the high, low, and closing prices for a given period, typically 14 days, to generate an average range of price movement.

Traders can use ATR to determine the level of risk associated with a particular trade. When the ATR value is high, it suggests that the security is experiencing greater fluctuations in price, indicating higher volatility and potential risk. Conversely, a low ATR value indicates lower price movement and less potential risk.

By using ATR to set trailing stops, traders can automate their buy and sell signals based on changes in volatility. To calculate the upper and lower limits using ATR, you can use the configurable ATRX multiplier. The resulting values are known as ATR short and ATR long, respectively. Traders can then use these limits to determine when to enter or exit a trade based on changes in volatility. ATR does not provide information about price direction, it is strongly recommended to use an additional momentum indicator like RSI.

Trailing stops

Using the configurable ATRX multiplier for ATR, a lower and upper trailing stop 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.

How to work with it

Buy method conditions

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

Sell method conditions

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

Trading example

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

ATRTS strategy settings

Buy settings

LabelConfig ParameterDefault ValueDetailed Description
Buy enabledBUY_ENABLEDtrueWhen enabled, this setting allows the strategy to initiate buy or long orders.

Sell settings

LabelConfig ParameterDefault ValueDetailed Description
Sell enabledSELL_ENABLEDtrueWhen enabled, this setting allows the strategy to initiate sell or short orders.
GainGAIN1Specifies the target gain above break-even, expressed as a percentage. Adjust this to set your profit goals for when the strategy should trigger a sell or close an order above the purchase price.
Stop limitSTOP_LIMIT99Sets the threshold for when to sell or close a position at a loss. For spot markets, the value represents a percentage below break-even.
Count sellCOUNT_SELL9999Disables trading for a pair after a specified number of sell orders have been executed since the pair was added. This helps manage the exposure to any single pair over time.

Indicators

LabelConfig ParameterDefault ValueDetailed Description
PeriodPERIOD15Defines the "size" of the candlesticks, in minutes, used for calculating indicators. It is important to choose a period supported by your exchange to ensure accurate indicator calculations.
ATRxATRX0.5This setting is a multiplier used to calculate the trade limits based on the Average True Range (ATR), helping to adjust the strategy's sensitivity to market volatility.
ATR periodATR_PERIOD14Specifies the number of candles used to calculate the Average True Range (ATR), influencing how market volatility is assessed over a given period.

Overview of effects on different order types

Config ParameterAffected Order TypesNot Affected Order Types
Buy EnabledStrategy buy, DCA buy, RT buy, RT buybackStrategy sell, Stop limit, Close, RT sell
Sell EnabledStrategy sell, Stop limit, RT sellStrategy buy, RT buy, RT buyback, Close, DCA buy
GainStrategy sellStrategy buy, RT buy, RT buyback, RT sell, Close, DCA buy, Stop limit
PeriodStrategy sell, Strategy buy, DCA buy (when using an indicator)RT buy, RT buyback, RT sell, Close, Stop limit
ATRxStrategy sell, Strategy buyRT buy, RT buyback, RT sell, Close, Stop limit, DCA buy
ATR PeriodStrategy sell, Strategy buyRT buy, RT buyback, RT sell, Close, Stop limit, DCA buy