Opening-Range BreakoutNote: Default trading date range looks mediocre. Set date range to "Entire History" to see full effect of the strategy. 50.91% profitable trades, 1.178 profit factor, steady profits and limited drawdown. Total P&L: $154,141.18, Max Drawdown: $18,624.36. High R^2
█ Overview
The Opening-Range Breakout strategy is a mechanical, session‑based day‑trading system designed to capture the initial burst of directional momentum immediately following the market open. It defines a user‑configurable “opening range” window, measures its high and low boundaries, then places breakout stop orders at those levels once the range closes. Built‑in filters on minimum range width, reward‑to‑risk ratios, and optional reversal logic help refine entries and manage risk dynamically.
█ How It Works
Opening‑Range Formation
Between 9:30–10:15 AM ET (configurable), the script tracks the highest high and lowest low to form the day’s opening range box.
On the first bar after the range window closes, the range high (OR_high) and low (OR_low) are “locked in.”
Range‑Width Filter
To avoid false breakouts in low‑volatility mornings, the range must be at least X% of the current price (default 0.35%).
If the measured opening-range width < minimum threshold, no orders are placed that day.
Entry & Order Placement
Long: a stop‑buy order at the opening‑range high.
Short: a stop‑sell order at the opening‑range low.
Only one side can trigger (or both if reverse logic is enabled after a losing trade).
Risk Management
Once triggered, each trade uses an ATR‑style stop-loss defined as a percentage retracement of the range (default 50% of range width).
Profit target is set at a configurable Reward/Risk Ratio (default 1.1×).
Optional: Reverse on Stop‑Loss – if the initial breakout loses, immediately reverse into the opposite side on the same day.
Session Exit
Any open positions are closed at the end of the regular trading day (default 3:45 PM ET window end, with hard flat at session close).
Visual cues are provided via green (range high) and red (range low) step‑line plots directly on the chart, allowing you to see the range box and breakout triggers in real time.
█ Why It Works
Early Momentum Capture: The first 15 – 60 minutes of trading encapsulate overnight news digestion and institutional order flow, creating a well‑defined volatility “range.”
Mechanical Discipline: Clear, rule‑based entries and exits remove emotional guesswork, ensuring consistency.
Volatility Filtering: By requiring a minimum range width, the system avoids choppy, low‑range days where false breakouts are common.
Dynamic Sizing: Stops and targets scale with the opening range, adapting automatically to each day’s volatility environment.
█ How to Use
Set Your Instruments & Timeframe
-Apply to any futures contract on a 1‑ to 5‑minute chart.
-Ensure chart timezone is set to America/New_York.
Configure Inputs
-Opening‑Range Window: e.g. “0930-1015” for a 45‑minute range.
-Min. OR Width (%): e.g. 0.35 for 0.35% of current price.
-Reward/Risk Ratio: e.g. 1.1 for a modest profit target above your stop.
-Max OR Retracement %: e.g. 50 to set stop at 50% of range width.
-One Trade Per Day: toggle to limit to a single breakout.
-Reverse on Stop Loss: toggle to flip direction after a losing breakout.
Monitor the Chart
-Watch the green and red range boundaries form during the session open.
-Orders will automatically submit on the first bar after the range window closes, conditioned on your filters.
Review & Adjust
-Backtest across multiple months to validate performance on your preferred contract.
-Tweak range duration, minimum width, and R/R multiple to fit your risk tolerance and desired win‑rate vs. expectancy balance.
█ Settings Reference
Input Defaults
Opening‑Range Window - Time window to form OR (HHMM-HHMM) - 0930–1015
Regular Trading Day - Full session for EOD flat (HHMM-HHMM) - 0930–1545
Min. OR Width (%) - Minimum OR size as % of close to trigger orders - 0.35
Reward/Risk Ratio - Profit target multiple of stop‑loss distance - 1.1
Max OR Retracement (%) - % of OR width to use as stop‑loss distance - 50
One Trade Per Day - Limit to a single breakout order per day - false
Reverse on Stop Loss - Reverse direction immediately after a losing trade - true
Disclaimer
This strategy description and any accompanying code are provided for educational purposes only and do not constitute financial advice or a solicitation to trade. Futures trading involves substantial risk, including possible loss of capital. Past performance is not indicative of future results. Traders should assess their own risk tolerance and conduct thorough backtesting and forward-testing before committing real capital.
Rangebreakout
Megabar Breakout (Range & Volume & RSI)Hey there,
This strategy is based on the idea that certain events lead to what are called Megabars. Megabars are bars that have a very large range and volume. I wanted to verify whether these bars indicate the start of a trend and whether one should follow the trend.
Summary of the Code:
The code is based on three indicators: the range of the bar, the volume of the bar, and the RSI. When certain values of these indicators are met, a Megabar is identified. The direction of the Megabar indicates the direction in which we should trade.
Why do I combine these indicators?
I want to identify special bars that have the potential to mark the beginning of a breakout. Therefore, a bar needs to exhibit high volume, have a large range (huge price movement), and we also use the Relative Strength Index (RSI) to assess potential momentum. Only if all three criteria are met within one candle, do we use this as an identifier for a megabar.
Explanation of Drawings on the Chart:
As you can see, there is a green background on my chart. The green background symbolizes the time when I'm entering a trade. Only if a Megabar happens during that time, I'm ready to enter a trade. The time is between 6 AM and 4 PM CET. It's just because I prefer that time. Also, the strategy draws an error every time a Megabar happens based on VOL and Range only (not on the RSI). That makes it pretty easy to go through your chart and check the biggest bars manually. You can activate or deactivate these settings via the input data of the strategy.
When Do We Enter a Trade?
We wait for a Megabar to happen during our trading session. If the Megabar is bullish, we open a LONG trade at the opening price of the next candle. If the Megabar is bearish, we open a SHORT trade at the opening price of the next candle.
Where Do We Put Our Take Profit & Stop Loss?
The default setting is TP = 40 Pips and SL = 30 Pips. In that case, we are always trading with a risk-reward ratio of 1.33 by default. You can easily change these settings via the input data of the strategy.
Strategy Results
The criteria for Megabars were chosen by me in a way that makes Megabars something special. They are not intended to occur too frequently, as the fundamental idea of this strategy would otherwise not hold. This results in only 37 closed trades within the last 12 months. If you change the criterias for a megabar to a milder one, you will create more Megabars and therefore more trades. It's up to you. I have adapted this strategy to the 30-minute chart of the EURUSD. In the evaluation, we consider a period of 12 months, which I believe is sufficient.
My default settings for the indicators look like this:
Avg Length Vol 20
Avg Multiplier Vol 3
Avg Length Range 20
Avg Multiplier Range 4
Value SMA RSI for Long Trades 50
Value SMA RSI for Short Trades 70
IMPORTANT: The current performance overview does not display the results of these settings. Please change the settings to my default ones so that you can see how I use this strategy.
I do not recommend trading this strategy without further testing. The script is meant to reflect a basic idea and be used as a tool to identify Megabars. I have made this strategy completely public so that it can be further developed. One can take this framework and test it on different timeframes and different markets.
Strategy: Range BreakoutWhat?
In the price action, levels have a significant role to play. Based on the price moving above/below the levels - the underlying instrument shows some price-action in the direction of breakout/breakdown.
There are plenty of ways level can be determined. Levels are the decision point to take a trade or not. But if we make the level derivation complex, then the execution may get hamper.
This strategy script, developed in PineScript v5, is our attempt at solving this problem at the core by providing this simple, yet elegant solution to this problem.
It's essentially an attempt to Trade Simple by drawing logical (horizontal) lines in the chart and take actions, after multiple associated parameters confirmation, on the breakout / breakdown of the levels.
How?
Let us explain how we are drawing the levels.
We are depending on some of the parameters as described below:
Open Range : During intraday movement, often if prices move beyond a particular level, it exibits more movement in the same swing in same direction. We found out, through our back testing for Indian Indices like NSE:NIFTY , NSE:BANKNIFTY or NSE:CNXFINANCE the first 15m (i.e 09:15 AM to 09:30 AM, IST) is one of such range. For Indian stocks, it is 9:15 to 9:45. And for MCX MCX:CRUDEOIL1! it's 5:00 pm to 6:00 pm. There are our first levels.
PDHCL : Previous Day High, Close, Low. This is our next level
VWAP : The rolling VWAP (volume weighted average price)
In the breakout/breakdown of the Open Range and Previous Day High/Low, we are taking the trade decisions as follows using CEST principle:
C onditions :
If current bar's (say you are in 5m timeframe) closing is broken out the Open Range High or Previous Day High, taken a Buy/Long decision (let's say buying a Call Option CE or selling a Put Option PE or buying the future or cash).
If current bar's (say you are in 5m timeframe) closing is broken down the Open Range Low or Previous Day Low, taken a Sell/Short decision (let's say buying a Put Option CE or selling a Call Option PE or selling the future or cash).
Additionally, and optionally (default ON, one can turn off): we are checking various other associated multiple confirmations as follows:
1. Momentum : Checking 14-period RSI value is more than 50 or less than 50 (all parameters like period, OB, OS ranges are configurable through settings)
2. Current bar's volume is more than the last 20 bars volume average. How much more - that multiplier is also configurable. (default is 1)
3. The breakout candle is bullish (green) or bearish (red).
E ntry :
All of these happens only on the closing of the candle . Means: Non Repainting! .
Clearly in the chart we are showing as green up arrow BO (breakout for buy) and red down arrow BD (breakdown for sell) to take your decision process smooth.
So, on the closing of the decision BO/BD candle we are entering the trade (with a thumping heart and nail biting ...)
S top Loss :
We are relying on the time tasted (last 40 years) mechanism of Average True Range (ATR) of default 14 period. This default period is also configurable.
So for Long trades: the 14 period ATR low band is the SL.
For Short trades: the 14 period ATR high band is the SL.
T arget :
We are depending on the thump rule of 1:2 Risk Reward. It's simple and effective. No fancy thing. We are closing the trade on double the favorable price movement compared to the SL placed. Of course, this RR ratio is confiurable from the settings, as usual.
What's Unqiue in it?
The utter simplicity of this trading mechanism. No fancy things like complex chart pattern, OI data, multiple candlestick patterns, Order flow analysis etc.
Simple level determination,
Marking clearly in the chart.
Making each parameter configurable in Settings and showing tooltip adjacent to the parameter to make you understand it better for your customization,
Wait for the candle close, thus eliminating the chances of repainting menace (as much as possible)
Additional momentum and volume check to trade entry confirmation.
Works with normal candlestick (nothing special ones like HA ...)
Showing everything as a Summary Table (which, again can be turned off optionally) overlaying at the bottom-right corner of the chart,
Optionally the Summary Table can be configured to alert you back (say you get it notified in your email or SMS).
That way, a single, simple, effective trade setup will ease your journey as smooth sail as possible.
Mentions
There are plenty of friends from whom time to time we borrowed some of the ideas while working closely together over last one year.
From tradingview community, we took the spirit of @zzzcrypto123 awesome work done long back (in 2020) as the indicator "ORB - Opening Range Breakout". (We tried to reach him for his explicit consent, unable to catch hold of him).
Some other publicly available materials we have consulted to get the additional checks (like RSI, volume).
Lat word
Use it please and thank you for your constant patronage in following us in this awesome platform. Let's keep growing together.
Disclaimer :
This piece of software does not come up with any warrantee or any rights of not changing it over the future course of time.
We are not responsible for any trading/investment decision you are taking out of the outcome of this indicator.
Pro Trading Art Open Range Breakout StrategyThis strategy is based on Selected Candle High Low Breakout with buffer point.
You can select specific candle from input tab by giving time of that candle.
Default Settings:
Start Hour : Hour of starting candle means from this input you can specify opening candle. Default is 9.
Start Minute: Minute of starting candle. Default is 15. Means Default opening candle is 9:15
Stop Hour : Means After this time no new trade will execute.
End Hour & End Minute & Close All Trade : Means when you specify End Hour and Minute and Close all trade is true then strategy will close all trade on specified time.
Buffer : With the help of this option you can add some point in High and low of Opening Candle
Trade Mode : You can specify Target and Stop Loss in point or Percent
Stop Loss Point or Percent : This will work according to Trade Mode
Target Point Or Percent : This will work according to Trade Mode