Turn Of The Month Trading Strategy (Amibroker And Tradestation Code)
The strategy in plain English:
We go long at the close on the fifth last trading day of the month, and we exit after seven days, ie. at the close of the third trading day of the next month. Thus, the strategy is invested around 33% of the time.
Click here for the original article.
Amibroker code:
Buy= Ref(Month(),4)!=Ref(Month(),5);
buyPrice=Close;
Sell= Ref(Month(),-2)!=Ref(Month(),-3);
sellPrice=Close ;
Tradestation code:
If DaysBeforeEOM(date) = 5 Then
buy this bar on Close;
If DaysFromBOM(date) = 3 Then
sell this bar on 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.
