NQ previous futures day sweep and reverse at 1R
A 5-minute bar trades through the previous futures day's high and closes back below it. A bar through its low that closes back above it counts too. From 9:30 to 15:30 New York the trade enters the other way at the next bar's open. The stop sits a tick beyond the sweep's wick and the target at 1R. One trade a day and flat by 16:00. Its inputs switch the previous session to New York hours and set the target.
- Trades
- 302
- Won
- 58.3%
- Profit factor
- 1.20
- Net
- +5.6%
- Worst drawdown
- −4.0%
- Worst trade
- −$1,409.50
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
+$260.50 from 4 November 2024 to 23 February 2026, +$2,545 from 24 February 2026 to 22 October 2026.
//@version=6
// Suggested timeframe: 5-minute
strategy("NQ previous session sweep and reverse", 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)
// Inputs: which previous session's high and low, and the target, on New York's clock
levelFrom = input.string("Futures day", "Previous session", options=["Futures day", "New York hours"])
rMult = input.float(1.0, "Target (R)", minval=0.5, step=0.5)
inRTH = not na(time(timeframe.period, "0930-1600", "America/New_York"))
canTrade = not na(time(timeframe.period, "0930-1530", "America/New_York")) and not session.islastbar
lastNY = not na(time(timeframe.period, "1555-1600", "America/New_York"))
// The previous futures day (18:00 to 17:00 New York) and the previous New York session (9:30 to 16:00)
var float dayHi = na
var float dayLo = na
var float prevDayHi = na
var float prevDayLo = na
var float rthHi = na
var float rthLo = na
var float prevRthHi = na
var float prevRthLo = na
if session.isfirstbar
prevDayHi := dayHi
prevDayLo := dayLo
dayHi := high
dayLo := low
else
dayHi := math.max(dayHi, high)
dayLo := math.min(dayLo, low)
if inRTH and not inRTH[1]
prevRthHi := rthHi
prevRthLo := rthLo
rthHi := high
rthLo := low
else if inRTH
rthHi := math.max(rthHi, high)
rthLo := math.min(rthLo, low)
pHi = levelFrom == "Futures day" ? prevDayHi : prevRthHi
pLo = levelFrom == "Futures day" ? prevDayLo : prevRthLo
// The sweep: a 5-minute bar trades through the previous session's high and closes back below it
// (short), or through its low and closes back above it (long). The trade enters at the next bar's
// open with the stop a tick beyond the sweep's wick and the target rMult times the risk
var int tradesToday = 0
var float stopLevel = na
var float targetLevel = na
if session.isfirstbar
tradesToday := 0
sweepHi = not na(pHi) and high > pHi and close < pHi
sweepLo = not na(pLo) and low < pLo and close > pLo
if canTrade and strategy.position_size == 0 and tradesToday < 1
if sweepHi
stopLevel := high + syminfo.mintick
targetLevel := close - (stopLevel - close) * rMult
strategy.entry("Short", strategy.short)
strategy.exit("Short exit", from_entry="Short", stop=stopLevel, limit=targetLevel)
tradesToday += 1
else if sweepLo
stopLevel := low - syminfo.mintick
targetLevel := close + (close - stopLevel) * rMult
strategy.entry("Long", strategy.long)
strategy.exit("Long exit", from_entry="Long", stop=stopLevel, limit=targetLevel)
tradesToday += 1
if strategy.position_size > 0
strategy.exit("Long exit", from_entry="Long", stop=stopLevel, limit=targetLevel)
if strategy.position_size < 0
strategy.exit("Short exit", from_entry="Short", stop=stopLevel, limit=targetLevel)
// Flat at 16:00, or on the session's last bar when the market closes early (a holiday half day) or
// halts for a long weekend
if lastNY or session.islastbar
strategy.close_all("Close", immediately=true)
plot(pHi, "Previous high", color=color.new(#16A56A, 0), style=plot.style_linebr)
plot(pLo, "Previous low", color=color.new(#E5484D, 0), style=plot.style_linebr)
