The paper's rule: the first half hour decides the last
From the previous day's 16:00 close to 10:00 New York: up, long at 15:30; down, short at 15:30. Out at 16:00, one contract.
- Trades
- 493
- Won
- 47.1%
- Profit factor
- 0.99
- Net
- −0.4%
- Worst drawdown
- −8.3%
- Worst trade
- −$504
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, one contract
-5.7% in the first 16 months, +5.6% in the last 8. $2.12 a trade before costs.
//@version=6
// Suggested timeframe: 5-minute
strategy("NQ market intraday momentum, the Gao, Han, Li and Zhou rule", 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 paper's rule (Gao, Han, Li and Zhou, 2018): the first half hour's return, from the previous day's 16:00 close
// to 10:00 New York, decides the direction of the last half hour, 15:30 to 16:00. One contract a trade
contracts = input.int(1, "Contracts", minval=1)
// New York's clock on 5-minute candles: the candle that ends at 10:00, the one whose close sends the order that
// fills at 15:30, and the one that ends at 16:00
ends10 = not na(time(timeframe.period, "0955-1000", "America/New_York"))
sends330 = not na(time(timeframe.period, "1525-1530", "America/New_York"))
ends16 = not na(time(timeframe.period, "1555-1600", "America/New_York"))
var float prevClose = na // the last 16:00 close
var float firstRet = na // today's first half-hour return, overnight move included
if ends10 and not na(prevClose)
firstRet := close / prevClose - 1
if sends330 and barstate.isconfirmed and strategy.position_size == 0 and not na(firstRet)
if firstRet > 0
strategy.entry("Long", strategy.long, qty=contracts)
else if firstRet < 0
strategy.entry("Short", strategy.short, qty=contracts)
// Out at 16:00, and that close starts the next day's first half hour
if ends16
strategy.close_all("16:00", immediately=true)
prevClose := close
firstRet := na
plotshape(sends330 and firstRet > 0, "Long", style=shape.triangleup, location=location.belowbar, color=color.new(#16A56A, 0), size=size.tiny)
plotshape(sends330 and firstRet < 0, "Short", style=shape.triangledown, location=location.abovebar, color=color.new(#E5484D, 0), size=size.tiny)