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 ofATRX
from next rounds bid. - The upper limit, called
ATR long
, is calculated by adding the result ofATRX
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​
Label | Config Parameter | Default Value | Detailed Description |
---|---|---|---|
Buy enabled | BUY_ENABLED | true | When enabled, this setting allows the strategy to initiate buy or long orders. |
Sell settings​
Label | Config Parameter | Default Value | Detailed Description |
---|---|---|---|
Sell enabled | SELL_ENABLED | true | When enabled, this setting allows the strategy to initiate sell or short orders. |
Gain | GAIN | 1 | Specifies 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 limit | STOP_LIMIT | 99 | Sets 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 sell | COUNT_SELL | 9999 | Disables 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​
Label | Config Parameter | Default Value | Detailed Description |
---|---|---|---|
Period | PERIOD | 15 | Defines 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. |
ATRx | ATRX | 0.5 | This 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 period | ATR_PERIOD | 14 | Specifies 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 Parameter | Affected Order Types | Not Affected Order Types |
---|---|---|
Buy Enabled | Strategy buy, DCA buy, RT buy, RT buyback | Strategy sell, Stop limit, Close, RT sell |
Sell Enabled | Strategy sell, Stop limit, RT sell | Strategy buy, RT buy, RT buyback, Close, DCA buy |
Gain | Strategy sell | Strategy buy, RT buy, RT buyback, RT sell, Close, DCA buy, Stop limit |
Period | Strategy sell, Strategy buy, DCA buy (when using an indicator) | RT buy, RT buyback, RT sell, Close, Stop limit |
ATRx | Strategy sell, Strategy buy | RT buy, RT buyback, RT sell, Close, Stop limit, DCA buy |
ATR Period | Strategy sell, Strategy buy | RT buy, RT buyback, RT sell, Close, Stop limit, DCA buy |