The January Effect That Works (Amibroker And Tradestation Code)
The strategy in plain English:
- Buy at the open in February if January is positive.
- Sell at the open the next January.
(If the S&P 500 decline in January, the average percentage change for the next eleven months is 2.25%. If the S&P 500 rises during January, the average percentage change in the next 11 months is 10.4%.)
Click here to see the original article.
Amibroker code:
Buy= Month()==2 AND TimeFrameGetPrice(“C”,inMonthly,-2) < TimeFrameGetPrice(“C”,inMonthly,-1);
buyPrice=Open;
Sell= Month()==1 AND Month()!=Ref(Month(),-1);
sellPrice=Open ;
Tradestation code:
//First set your interval to Monthly bars
If c>c[1] and month(date) = 1 then buy next bar at open;
If barssinceentry=10 then 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.
