London range breakout, 2R
From 08:00 New York, long on the first 5-minute close above the 03:00 to 08:00 high and short on the first close below its low; the stop at the range's other side, the target at twice the risk, out at 11:30.
- Trades
- 452
- Won
- 48.0%
- Profit factor
- 1.08
- Net
- +12.1%
- Worst drawdown
- −14.4%
- Worst trade
- −$607
MNQ1! · 5-minute · 23 October 2024 → 22 October 2026 · 2 years · 517 sessions · $0.75 a contract each side, one tick of slippage, $50,000 account, 1% risk
+10.0% in the first 16 months, +1.9% in the last 8. 48.0% of trades won.
//@version=6
// Suggested timeframe: 5-minute
strategy("NQ London range breakout", overlay=true, initial_capital=50000, default_qty_type=strategy.fixed, default_qty_value=1,
commission_type=strategy.commission.cash_per_contract, commission_value=0.75, slippage=1, margin_long=0, margin_short=0)
// The rule, written down before the run: the high and low from 03:00 to 08:00 New York, London's morning. From
// 08:00 to 11:25, long on the first 5-minute close above the high, short on the first close below the low; the stop
// at the range's other side, the target at twice the risk; one trade a day, out at 11:30. 1% of the account at risk
// with two ticks of slippage counted, at most 10 contracts; a stop too wide for one skips the trade
riskPct = input.float(1.0, "Risk % per trade", minval=0.1, step=0.1)
rMult = input.float(2.0, "Target (R)", minval=0.5, step=0.5)
maxContracts = input.int(10, "Max contracts", minval=1)
// New York's clock; a future's day starts at the 18:00 New York reopen
inLondon = not na(time(timeframe.period, "0300-0800", "America/New_York"))
inTrade = not na(time(timeframe.period, "0800-1125", "America/New_York")) // the last order fills by 11:25
ends1130 = not na(time(timeframe.period, "1125-1130", "America/New_York"))
// The day's state, set back on its first bar
var float lHigh = na
var float lLow = na
var bool tradedToday = false
var float stopLevel = na
var float targetLevel = na
if session.isfirstbar
lHigh := na
lLow := na
tradedToday := false
if inLondon
lHigh := na(lHigh) ? high : math.max(lHigh, high)
lLow := na(lLow) ? low : math.min(lLow, low)
// The setup: the first close outside London's range
rangeSet = not inLondon and not na(lHigh)
longSetup = rangeSet and close > lHigh and close[1] <= lHigh
shortSetup = rangeSet and close < lLow and close[1] >= lLow
riskCash = math.max(strategy.equity, 0) * riskPct / 100
canTrade = inTrade and not tradedToday and strategy.position_size == 0 and barstate.isconfirmed
if canTrade and longSetup
stopPts = close - lLow
qty = math.min(maxContracts, math.floor(riskCash / ((stopPts + 2 * syminfo.mintick) * syminfo.pointvalue)))
if qty >= 1
stopLevel := lLow
targetLevel := close + stopPts * rMult
strategy.entry("Long", strategy.long, qty=qty)
strategy.exit("Long exit", from_entry="Long", stop=stopLevel, limit=targetLevel)
tradedToday := true
if canTrade and shortSetup
stopPts = lHigh - close
qty = math.min(maxContracts, math.floor(riskCash / ((stopPts + 2 * syminfo.mintick) * syminfo.pointvalue)))
if qty >= 1
stopLevel := lHigh
targetLevel := close - stopPts * rMult
strategy.entry("Short", strategy.short, qty=qty)
strategy.exit("Short exit", from_entry="Short", stop=stopLevel, limit=targetLevel)
tradedToday := true
// The same stop and target on every bar of the trade; out at 11:30, or at a short session's last bar
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)
if ends1130 or session.islastbar
strategy.close_all("11:30", immediately=true)
plot(rangeSet ? lHigh : na, "London high", color=color.new(#16A56A, 0), style=plot.style_linebr)
plot(rangeSet ? lLow : na, "London low", color=color.new(#E5484D, 0), style=plot.style_linebr)