ATR_Trade_strategy executes long trades when price breaks above the upper ATR band and opens short positions when price falls below the lower band, with an option to trigger on typical price. Positions exit upon crossing the moving average, crossing the midline if enabled, or reaching a percentage-based maximum loss limit. Key settings adjust the ATR length, smoothing method, moving average period, and trade quantities. A notable limitation is the use of higher-timeframe security calls with lookahead enabled, causing lookahead bias.
The inputs you can change from the gear icon on the chart. Defaults are the author's.
Setting
Type
Default
Variable
Show Middle Line
bool
false
showMiddle
Show EMA Line
bool
true
showEMA
Show Typical Line
bool
false
showTypical
Length
int
14
length
Smoothing
string
EMA
smoothing
Max Loss on one Trade
float
0.5
maxLoss
EMA Periods
int
10
emaCount
Trade Quanity
int
10
tradeQty
Stop Loss as Middle
bool
false
SlasMiddle
Trade on Typical
bool
false
onTypical
Third-party code. ForexR did not write, test or endorse this script, and the summary above was generated automatically from its code and README. Indicators describe the past, and a strategy's backtest can look better than live trading, especially when a script repaints. Check it in the Strategy Tester and on a demo account before you rely on it.
This price-chart strategy plots a simple moving average and upper and lower bands built from the standard deviation of close, scaled by separate offset inputs. It enters a fixed quantity long when close crosses above the upper band and a fixed quantity short w
This strategy trades long breakouts of a fast and a slow moving average on the price chart. It opens a long position when price crosses above either average, using a percentage of equity as size. It reduces the position by a set share when the high reaches the
This strategy plots exponential-moving-average Bollinger bands on the price chart and calculates RSI. It opens a long position when close crosses above the upper band while RSI is at or above a threshold, the date filter allows trading, and no position is open
This strategy builds Keltner-style bands around an exponential or simple moving average of the chosen source. Band width uses average true range, raw true range, or a smoothed high-low range, scaled by a multiplier. When the source crosses above the upper band
This strategy plots Donchian channels, trailing stops, and profit targets directly on the price chart. It enters breakout trades using a 55-bar Donchian channel and sizes positions according to an ATR-based risk percentage per unit. The system adds units as pr
This strategy combines channel breakout concepts with an ATR-ADX volatility trailing framework and multi-timeframe moving averages. It evaluates trend conditions using configurable moving average types, including SMA, EMA, Hull MA, and Tilson T3, paired with d