MNQ opening range breakout flat by 15:55 New York
A 15-minute opening range from 9:30 New York. The first close through it after a close inside it enters from 9:45 to 12:00 and the day takes one trade. The stop sits at the range's other side and the target at 2R. Every trade closes on the 15:55 New York bar or on the session's last bar. No order is left waiting.
- Trades
- 500
- Won
- 45.4%
- Profit factor
- 1.00
- Net
- −0.2%
- Worst drawdown
- −17.6%
- Worst trade
- −$749
MNQ1! · 5-minute · 4 Nov 2024 → 22 Oct 2026 · $2.50 a contract each side and a tick of slippage · one contract on a $50,000 account
+$8,255 from 4 November 2024 to 23 February 2026, −$8,380 from 24 February 2026 to 22 October 2026.
//@version=6
// Suggested timeframe: 5-minute
strategy("MNQ opening range breakout, flat before the session ends", overlay=true, initial_capital=50000, default_qty_type=strategy.fixed, default_qty_value=1,
commission_type=strategy.commission.cash_per_contract, commission_value=2.5, slippage=1, margin_long=0, margin_short=0)
// ── Flat before the session ends ─────────────────────────────────────────────────────────────────
flatOn = input.bool(true, "Flat before the session ends", group="Session end")
flatAt = input.session("1555-1600", "Flat from (New York)", group="Session end")
// Name the clock: with no zone, hour() and minute() read the exchange's clock, Chicago on CME's NQ
// and ES, an hour behind New York. session.islastbar also catches a holiday's early close
flatNow = flatOn and (not na(time(timeframe.period, flatAt, "America/New_York")) or session.islastbar)
// From the flat time on: no order left waiting and every trade closed at the bar's close
if flatNow
strategy.cancel_all()
strategy.close_all("Flat", immediately=true)
// ── The example strategy: a 15-minute opening range breakout, one trade a day ──────────────────
// Your own entries go here, behind "not flatNow"
orSess = input.session("0930-0945", "Opening range (New York)", group="Strategy")
tradeSess = input.session("0945-1200", "Entry window (New York)", group="Strategy")
rMult = input.float(2.0, "Target (R)", minval=0.5, step=0.5, group="Strategy")
inOR = not na(time(timeframe.period, orSess, "America/New_York"))
inTrade = not na(time(timeframe.period, tradeSess, "America/New_York"))
var float orHigh = na
var float orLow = na
var int tradesToday = 0
var float stopLevel = na
var float targetLevel = na
if session.isfirstbar
orHigh := na
orLow := na
tradesToday := 0
if inOR
orHigh := na(orHigh) ? high : math.max(orHigh, high)
orLow := na(orLow) ? low : math.min(orLow, low)
// The setup: the first close through the range after a close inside it. The stop sits at the
// range's other side and the target at rMult times the risk
rangeSet = not inOR and not na(orHigh)
longSetup = rangeSet and close > orHigh and close[1] <= orHigh
shortSetup = rangeSet and close < orLow and close[1] >= orLow
canTrade = inTrade and strategy.position_size == 0 and tradesToday < 1 and not flatNow
if canTrade and longSetup and orLow < close
stopLevel := orLow
targetLevel := close + (close - orLow) * rMult
strategy.entry("Long", strategy.long)
strategy.exit("Long exit", from_entry="Long", stop=stopLevel, limit=targetLevel)
tradesToday += 1
else if canTrade and shortSetup and orHigh > close
stopLevel := orHigh
targetLevel := close - (orHigh - close) * rMult
strategy.entry("Short", strategy.short)
strategy.exit("Short exit", from_entry="Short", stop=stopLevel, limit=targetLevel)
tradesToday += 1
plot(rangeSet ? orHigh : na, "Range high", color=color.new(#16A56A, 0), style=plot.style_linebr)
plot(rangeSet ? orLow : na, "Range low", color=color.new(#E5484D, 0), style=plot.style_linebr)
