Overnight In The S&P 500 – 5 Day Low (Amibroker And Tradestation Code)
The strategy in plain English:
- SPY closes lower than the previous day’s 5 day low.
- Close is above the 200-day moving average.
- (c-l)/(h-l) (IBS) gives a ratio lower than 0.4.
- Go long at the close, exit at tomorrow’s open.
Click here for the original article.
Amibroker code:
setOption(“holdminbars”,1);
ibs=(C-L)/(H-L) ;
Buy= C<Ref(LLV(L,5),-1) AND ibs<0.4 AND Close>MA(C,200);
buyPrice= Close;
Sell= C>0; // to force exit next day
sellPrice= Open ;
Tradestation code:
If c < lowest(l,5)[1]
and c > average(c,200)
and IFF((H-L)<>0,((C-L))/(H-L),1) <= 0.4
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.
