Position sizing is calculated from an Average True Range (ATR) volatility model. The script scales into winning trades up to a user-defined unit limit only when RSI confirms momentum direction. Stop losses dynamically shift to breakeven once price advances by a target ATR multiple, with trailing stops and optional three-stage profit targets securing gains. An optional higher-timeframe moving average serves as an overall market regime filter. Plots overlay directly on the price chart.
The inputs you can change from the gear icon on the chart. Defaults are the author's.
Setting
Type
Default
Variable
Allow LONGs?
bool
true
allowLong
Allow SHORTs?
bool
true
allowShort
Donchian ENTRY
int
55
entryLen
RSI length
int
14
rsiLen
RSI for LONG adds
float
60.0
rsiLongAdd
RSI for SHORT adds
float
40.0
rsiShortAdd
N = ATR length
int
20
nLen
Initial stop (N)
float
2.0
stopN
Move to BE after X*N
float
2.0
breakEvenN
Trail lookback
int
22
trailLen
Trail (N)
float
3.0
trailN
Add every X*N
float
0.5
addStepN
Show all 28 settings
Setting
Type
Default
Variable
Max units
int
4
maxUnits
Risk % per unit
float
1.0
riskPct
Use targets?
bool
true
useTargets
T1 (N)
float
3.0
target1N
T2 (N)
float
6.0
target2N
T3 (N)
float
9.0
target3N
Use regime filter?
bool
false
useMarket
Market symbol
symbol
SPY
marketSym
Regime TF
timeframe
D
marketTF
Market MA
int
200
marketLen
Min volume
int
0
minVol
Plot signals?
bool
true
showSignals
Plot Donchian?
bool
true
plotDon
FROM
time
timestamp("2022-01-01T00:00:00")
fromDate
TO
time
timestamp("2099-12-31T23:59:59")
toDate
FLAT at range start?
bool
true
flatAtFrom
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 strategy enters long or short on the price chart when price is on the correct side of a 200-period EMA, MACD agrees, RSI is not at the opposing extreme, ADX exceeds a threshold, volume beats a 20-bar average, and close breaks the recent high or low. A tim
This strategy trades longs and shorts on the price chart. Long entries require a close above the prior Donchian high, a close above a long-term SMA, and RSI above a threshold, with size set as a percentage of equity. Long exits use a stop at the prior Donchian
This strategy plots dynamic pivot-based support and resistance trendlines on the price chart and trades breakouts beyond those lines. By default it allows longs only when EMA 50 is above EMA 200 and an RSI-SMA momentum filter is met, with an ATR entry buffer.
This strategy combines the ATR-banded Q-Trend indicator with the Klinger Volume Oscillator (KVO) to execute confluence trades. It enters long when a Q-Trend buy trigger aligns with a positive KVO value and a bullish candle confirmation, taking short trades und
This trend-following strategy executes a classic Donchian channel breakout system designed to cross-validate backtest results against external framework benchmarks. It triggers a long entry when the closing price breaks above the highest high of the prior entr
2 EMA/SMA + RSI Strategy [Alorse] combines three configurable moving averages with a short-period Relative Strength Index filter. It plots fast, slow, and trend moving averages on the price chart. Long entries trigger when the fast moving average is above the