Purpose of the Average True Range (ATR)
The ATR measures market volatility by calculating the average range between high and low prices over a set period. It helps traders understand how much an asset typically moves and adjust position sizing or stop-loss levels accordingly.
How It Works
When you select Average True Range in the Trade Rule block, you can configure:
ATR Period
The number of candles used for calculation.
Common setting: 14, meaning the ATR is based on the past 14 candles.
Shorter periods react faster to recent volatility; longer periods smooth the values.
Advanced Options
Time Frame
Select the chart time frame for the ATR calculation.
Can be replaced with a variable or input to make optimization and testing easier.
Candle ID
0 – Current forming candle.
1 – Last closed candle (most commonly used).
Higher IDs = older candles.
Adjust
Modify the ATR value by adding, subtracting, multiplying, or dividing by a number.
Example: Multiply by 2 to quickly set a stop-loss at twice the average range.
Example
If you set:
ATR Period: 14
Time Frame: Current
Candle ID: 1
You get the average price range of the last 14 closed candles on the current chart time frame.
Use Cases
Dynamic stop-loss and take-profit levels.
Measuring volatility for position sizing.
Avoiding trades during low volatility.
⚠ Tip: ATR does not indicate price direction—only volatility. Combine it with trend or momentum indicators for better results.
