PROTECTED SOURCE SCRIPT

Opening Range Breakout & Targets [Strategy] (Fixed + Alerts)

14
This strategy backtests a classic Opening Range Breakout approach using a configurable opening range window (time-based OR or custom session). Once the opening range is completed, the strategy waits for price to break above ORH (Opening Range High) or below ORL (Opening Range Low) and enters in the direction of the breakout.

Targets are derived directly from the opening range width:

OR Width = ORH − ORL

Target Step = OR Width × Target %

Take-profit is placed at the selected Target # (T1, T2, etc.)

An optional Daily Bias filter can be enabled to reduce false breakouts by comparing today’s opening range midpoint (ORM) to the previous session’s ORM. When bias is active, breakouts against the bias can require a stronger confirmation (break beyond the first target step).

Risk management is configurable via multiple stop options:

Stop at Opposite OR

Stop at OR Midpoint

Stop at 1× Target Step

Or disable stops for custom management

Includes support for:

Long/Short/Both modes

One trade per session option

Optional exit on opposite breakout

Separate alert conditions (when used with the companion indicator)

Note: This is a backtesting tool. Always validate results across symbols/timeframes and account for slippage/commissions before live use.

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.