OPEN-SOURCE SCRIPT
15M ORB + Possible Alerts + Dollar Backtest

This strategy is built around the exact 9:30–9:45 AM Eastern opening range breakout (ORB).
The script pulls the completed 15-minute opening candle directly from the 15-minute timeframe, even when the strategy is used on a lower-timeframe chart. This helps keep the ORB levels consistent across supported chart timeframes.
The strategy is designed for intraday futures testing and includes optional filters to help reduce weaker breakouts.
HOW IT WORKS
The script identifies the high and low of the completed 9:30–9:45 AM Eastern opening-range candle.
After 9:45 AM, it watches for a confirmed breakout:
• Long setup: price closes above the ORB high by the selected tick buffer
• Short setup: price closes below the ORB low by the selected tick buffer
By default, the breakout candle must also meet the minimum candle-body-strength requirement.
STOP LOSS AND TAKE PROFIT
• Long stop loss: below the ORB low with an optional tick buffer
• Short stop loss: above the ORB high with an optional tick buffer
• Take profit: calculated using the selected reward-to-risk ratio
• Default target: 1.5R
• Open trades are closed by 4:00 PM Eastern
OPTIONAL CONFIRMATION FILTERS
The script includes several optional filters that can be enabled or disabled for testing:
• VWAP direction filter
• Higher-timeframe EMA trend filter
• Higher-timeframe EMA slope confirmation
• Stochastic momentum confirmation
• Two consecutive closes outside the ORB
• Retest confirmation after breakout
• One trade per day
HIGHER-TIMEFRAME TREND FILTER
The higher-timeframe trend filter uses completed candles to help reduce repainting.
For a long setup:
• The completed higher-timeframe close must be above the EMA
• The EMA slope can optionally be required to be rising
For a short setup:
• The completed higher-timeframe close must be below the EMA
• The EMA slope can optionally be required to be falling
The higher-timeframe chart is adjustable. Common test settings include:
• 15 minutes
• 1 hour
• 4 hours
• 1 day
ALERTS
The strategy includes early heads-up alerts and confirmed-entry alerts.
Possible long or short alerts are intended only as warnings that price is testing an ORB boundary. They are not confirmed entries.
Confirmed long or short alerts trigger only after the selected strategy rules are met.
For TradingView alerts, select:
• Order fills and alert() function calls
BACKTESTING
This script is a TradingView strategy, so results appear in the Strategy Tester.
The strategy automatically adapts its dollar calculations to the charted futures contract and selected number of contracts.
It can be tested on instruments such as:
• MES
• ES
• MNQ
• NQ
RECOMMENDED STARTING SETTINGS
• Chart timeframe: 5 minutes
• ORB: fixed at 9:30–9:45 AM Eastern
• Confirmed breakout buffer: 4 ticks
• Minimum breakout candle body: 55%
• VWAP filter: on
• Higher-timeframe trend filter: on
• Higher-timeframe EMA length: 50
• Stochastic filter: off
• Two-close confirmation: off
• Retest confirmation: off
• One trade per day: on
• Reward-to-risk target: 1.5R
IMPORTANT NOTES
Historical results do not guarantee future performance.
Backtesting results may differ from live trading because of slippage, commissions, spread, order execution, and intrabar price movement.
Possible alerts may trigger before a candle closes. Confirmed entries are intended to be evaluated using closed candles.
This strategy is for educational and testing purposes only and is not financial advice.
The script pulls the completed 15-minute opening candle directly from the 15-minute timeframe, even when the strategy is used on a lower-timeframe chart. This helps keep the ORB levels consistent across supported chart timeframes.
The strategy is designed for intraday futures testing and includes optional filters to help reduce weaker breakouts.
HOW IT WORKS
The script identifies the high and low of the completed 9:30–9:45 AM Eastern opening-range candle.
After 9:45 AM, it watches for a confirmed breakout:
• Long setup: price closes above the ORB high by the selected tick buffer
• Short setup: price closes below the ORB low by the selected tick buffer
By default, the breakout candle must also meet the minimum candle-body-strength requirement.
STOP LOSS AND TAKE PROFIT
• Long stop loss: below the ORB low with an optional tick buffer
• Short stop loss: above the ORB high with an optional tick buffer
• Take profit: calculated using the selected reward-to-risk ratio
• Default target: 1.5R
• Open trades are closed by 4:00 PM Eastern
OPTIONAL CONFIRMATION FILTERS
The script includes several optional filters that can be enabled or disabled for testing:
• VWAP direction filter
• Higher-timeframe EMA trend filter
• Higher-timeframe EMA slope confirmation
• Stochastic momentum confirmation
• Two consecutive closes outside the ORB
• Retest confirmation after breakout
• One trade per day
HIGHER-TIMEFRAME TREND FILTER
The higher-timeframe trend filter uses completed candles to help reduce repainting.
For a long setup:
• The completed higher-timeframe close must be above the EMA
• The EMA slope can optionally be required to be rising
For a short setup:
• The completed higher-timeframe close must be below the EMA
• The EMA slope can optionally be required to be falling
The higher-timeframe chart is adjustable. Common test settings include:
• 15 minutes
• 1 hour
• 4 hours
• 1 day
ALERTS
The strategy includes early heads-up alerts and confirmed-entry alerts.
Possible long or short alerts are intended only as warnings that price is testing an ORB boundary. They are not confirmed entries.
Confirmed long or short alerts trigger only after the selected strategy rules are met.
For TradingView alerts, select:
• Order fills and alert() function calls
BACKTESTING
This script is a TradingView strategy, so results appear in the Strategy Tester.
The strategy automatically adapts its dollar calculations to the charted futures contract and selected number of contracts.
It can be tested on instruments such as:
• MES
• ES
• MNQ
• NQ
RECOMMENDED STARTING SETTINGS
• Chart timeframe: 5 minutes
• ORB: fixed at 9:30–9:45 AM Eastern
• Confirmed breakout buffer: 4 ticks
• Minimum breakout candle body: 55%
• VWAP filter: on
• Higher-timeframe trend filter: on
• Higher-timeframe EMA length: 50
• Stochastic filter: off
• Two-close confirmation: off
• Retest confirmation: off
• One trade per day: on
• Reward-to-risk target: 1.5R
IMPORTANT NOTES
Historical results do not guarantee future performance.
Backtesting results may differ from live trading because of slippage, commissions, spread, order execution, and intrabar price movement.
Possible alerts may trigger before a candle closes. Confirmed entries are intended to be evaluated using closed candles.
This strategy is for educational and testing purposes only and is not financial advice.
Script open-source
Dans l'esprit TradingView, le créateur de ce script l'a rendu open source afin que les traders puissent examiner et vérifier ses fonctionnalités. Bravo à l'auteur! Bien que vous puissiez l'utiliser gratuitement, n'oubliez pas que la republication du code est soumise à nos Règles.
Clause de non-responsabilité
Les informations et publications ne sont pas destinées à être, et ne constituent pas, des conseils ou recommandations financiers, d'investissement, de trading ou autres fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.
Script open-source
Dans l'esprit TradingView, le créateur de ce script l'a rendu open source afin que les traders puissent examiner et vérifier ses fonctionnalités. Bravo à l'auteur! Bien que vous puissiez l'utiliser gratuitement, n'oubliez pas que la republication du code est soumise à nos Règles.
Clause de non-responsabilité
Les informations et publications ne sont pas destinées à être, et ne constituent pas, des conseils ou recommandations financiers, d'investissement, de trading ou autres fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.