1Copy the scriptPress Copy script above. It reads the file straight from GitHub.
2Open the Pine EditorOpen a TradingView chart and choose Pine Editor at the bottom of the screen.
3Paste over the templateCreate a new strategy, select all of the template text and paste. Press Save and give it a name.
4Add it to the chartPress Add to chart. The trades and results appear in the Strategy Tester tab; adjust the settings with the gear icon.
Source Code
The code stays on GitHub. The author has not published this script under an open licence, so ForexR does not show its code. Copy script reads the file straight from GitHub into your clipboard, so you can still try it on your own chart. Ask the author before reusing the code anywhere else.
Overview
OPTD ORB Strategy waits for a specified number of consecutive closes beyond the range high or low on a separate signal timeframe to generate a long or short entry. The default stop loss anchors to the opposite rail at 1R, where R equals the opening range width, and the target is set at 2R. A maximum of one trade per session is allowed, after which the position is flattened at the end of the regular trading session. The range levels remain invariant across timeframes while the breakout counter runs independently.
The inputs you can change from the gear icon on the chart. Defaults are the author's.
Setting
Type
Default
Variable
Opening Range Time (EST)
session
0930-1000
orSess
Regular Session Time (EST)
session
0930-1600
rthSess
Timezone
string
America/New_York
tz
Signal timeframe
timeframe
1
sigTF
Consecutive closes outside range for signal
int
1
nCloses
Direction
string
Both
dir
Stop (R = OR width)
float
1.0
stopR
Target (R multiple)
float
2.0
rTarget
Max one trade per session
bool
true
oneTrade
Flatten at end of session
bool
true
flatEOD
ORH
color
color.new(#2962ff, 0)
colH
ORL
color
color.new(#e91e63, 0)
colL
Show all 14 settings
Setting
Type
Default
Variable
ORM
color
color.new(#787b86, 0)
colM
Shade range
bool
true
showFill
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 evaluates breakout and trend opportunities on the price chart using a weighted composite score of volume, trend, and candlestick structure. It tracks volume spikes, fast and slow EMAs, higher-timeframe EMA trend alignment, opening ranges, and ses
This strategy trades Nikkei 225 futures during a configurable overnight session, defaulting to 19:00–03:00 ET. It builds long and short trend conditions from an 8/21 EMA pair and a 200-period SMA, with RSI, momentum, an ATR-scaled breakout range, and a volume
This strategy identifies volatility breakout opportunities by constructing dynamic ATR-based price boxes and detecting volatility squeezes. Trades are filtered using an exponential moving average trend condition and designated session hours. Entries trigger up
This strategy trades EUR/USD breakouts on the price chart using Ichimoku values. It marks a compressed range when the Senkou spans twist and the range height stays under a pip limit. It enters long on a close above the prior range high, or short below the prio
This strategy tracks GBP/USD market structure by storing confirmed pivot highs and lows. It enters long when price crosses above the last pivot high while above a trend EMA, and short when price crosses below the last pivot low while below that EMA. Entries oc