Nasdaq (QQQ) Mean Reversion (Amibroker And Tradestation Code)
The strategy in plain English:
- IBS (internal bar strength) must be lower than 0.25.
- RSI (5) must be below 25.
- If 1 and 2 are fulfilled, go long at the close.
- Exit when close is higher than yesterday’s high (you can use higher than yesterday’s close as well – it has shorter holding periods and less drawdown).
Click here for the original article.
Amibroker code:
setOption(“holdminbars”,1);
ibs=(C-L)/(H-L) ;
Buy=RSI(5)<25 anD ibs<0.25;
buyPrice= Close;
Sell= C>Ref(H,-1); // alternatively use c>ref(c,-1)
sellPrice= Close ;
Tradestation code:
If IFF((H-L)<>0,((C-L))/(H-L),1) <= 0.25
and rsi(c,5)<25
then buy this bar at close;
If c>h[1] then Sell this bar at close;
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.
