The Holiday Effect: Labor Day (Amibroker And Tradestation Code)
The strategy in plain English:
- We buy the S&P 500 at the close of the second last trading day of August. For example, we buy at the close on the 30th of August so we are long on the open of the last trading day of August.
- We sell at the close on the first Tuesday of September (after the first Monday).
Click here for the original article.
Amibroker code:
Buy= Ref(Month(),1)!=Ref(Month(),2) AND Month()==8 ;
buyPrice=Close;
Sell= DayOfWeek()==2 AND Day()>1 AND Day()<20;
sellPrice=Close ;
Tradestation code:
{
The Holiday Effect: Labor day (strategy 13)
https://www.quantifiedstrategies.com/trading-the-holiday-effect-anomaly-in-stock-markets/
We buy the S&P 500 at the close of the second last trading day of August.
For example, we buy at the close on the 30th of August so we are long on the open of the last trading day of August.
We sell at the close on the first Tuesday of September (after the first Monday).
}
if (TdaysTillMonthEnd=1) and (Month(Date)=8) Then
Buy this bar on close;
if (Dayofweek(Date)=2) and (Dayofmonth(Date)>1) and (Dayofmonth(Date)<20) 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.
