An overnight In The S&P 500 (Or Nasdaq) (Amibroker And Tradestation Code)

The strategy in plain English:

 

If today’s open is lower than the previous day’s five day low, then enter at the close and exit at tomorrow’s open.

 

Amibroker code:

 

setOption(“holdminbars”,1);

Buy= Open<Ref(LLV(L,5),-1) ;

buyPrice=close;

Sell= C>0; // force position to close next day

sellPrice= Open ;

 

 

Tradestation code:

 

Var:Rangeentry(0);
Rangeentry=average(range,25);
If o < l[5]
then buy this bar at close;
Sell next bar at open;

 

Disclosure: We are not financial advisors. Please do your own due diligence and investment research or consult a financial professional. All articles are our opinions – they are not suggestions to buy or sell any securities.