R is the initial stop distance of a trade. Settings in R mean the same thing on gold at $1,800 and at $4,500, on Bitcoin and on EURUSD. You set the rule once and it scales with every trade.
In the author's Bitcoin breakout tests, moving the stop to break-even at +1R was the most effective single change. The win rate rose from about 20% to about 50%, and the longest losing streak fell from 16–21 trades to 8–9. Many would-be losers became small scratch trades, and the big winners were not touched.
The reference price is the close of the last completed bar of the chosen timeframe (default H1), which is how most backtests evaluate exits. It can also use the live bid/ask.
double gainR=(is_buy?px-open:open-px)/R; if(gainR>=InpBE_R) // break-even + lock new_sl=is_buy?MathMax(sl,open+InpLock_R*R):MathMin(sl,open-InpLock_R*R); if(InpTrailStartR>0 && gainR>=InpTrailStartR) // R trail new_sl=is_buy?MathMax(new_sl,px-InpTrail_R*R):MathMin(new_sl,px+InpTrail_R*R);
| Input | Default | Description |
|---|---|---|
| Magic filter | −1 | −1 all trades, 0 manual only, or one magic number |
| Only chart symbol | true | Restrict to the chart symbol |
| Break-even trigger | 1.0 R | Distance that triggers break-even |
| Locked profit | 0.1 R | Profit locked at break-even |
| Trail start | 2.0 R | 0 = no trailing |
| Trail distance | 2.0 R | Distance behind price |
| Closed bars only | true | Evaluate once per bar |
| Bar timeframe | H1 | Timeframe for the closed-bar check |
Author: Shipra Gupta (SGupta30) · the author's gold and Bitcoin EAs include break-even and R-based exits built in.
ATR Trailing Stop Line (Chandelier Exit)
ATR Trailing Stop Line (Chandelier Exit): a volatility-based trailing stop that hangs below the highest high in an up-trend and rises above the lowest low in a down-trend, with trend-flip arrows, an on-chart status label and optional alerts.
Kaufman Adaptive Moving Average (KAMA) Ribbon
A ribbon of Kaufman Adaptive Moving Averages with growing Efficiency Ratio periods, drawn in a monochrome gradient, with an on-chart label showing whether the ribbon is bullish, bearish or mixed.
MTF Trend Dashboard — trend, position and volatility on six timeframes at a glance
One on-chart table for M15, H1, H4, D1, W1 and MN1: EMA slope, price vs EMA, Donchian position, ATR percentile and a combined UP / DOWN / RANGE regime. Completed bars only. Any symbol.
MACD Signals
Indicator edition for new platform.