Mind the gap (with NinjaScript)

rnicoll

Established member
Messages
500
Likes
14
Here's a wacky one for ya; mind the gap. Was originally designed for shares, but turned out that with tweaks it worked better on the e-mini S&P. Basic idea is simple; half an hour before NYSE market close, enter the market in the direction it's gone fastest during the day. On market open the next day. close out. I've only managed to get 4 months test data from IB, but it comes out at 11%-ish profit (before commission). When running this, parameters for the backtest are important:

1. Market hours should be NYSE market hours, not e-mini S&P trading hours.
2. Ensure "Exit on close" (I think that's right) is set to false, or NT won't hold positions overnight.
3. Sample window is how long to wait before opening a position, in minutes. 360 works well, but feel free to try other values.

As always strategies are presented for academic curiousity only, and if you decide to trade it, on your own head be it. Certainly, I'm not trading this as-is.
 

Attachments

  • mindthegap.png
    mindthegap.png
    32.7 KB · Views: 994
  • MindTheGap.zip
    2.7 KB · Views: 356
Top