End Of Month Strategy In The S&P 500 (Amibroker And Tradestation Code)

The strategy in plain English:

 

The end of the month effect is still working. Buy on a down day and low IBS if one of the three last days of the month.

  1. The calendar day must be 29, 30, or 31.
  2. The close is lower than yesterday.
  3. The IBS is lower than 0.25.
  4. If 1-3 is true, go long at the close.
  5. Sell when today’s close is higher than yesterday’s high or the close is higher for a second time in a row.

 

Click here to see the original article.

 

Amibroker code:

 

ibs=(C-L)/(H-L) ;

 

Buy= (Day()==29 OR Day()==30 OR Day()==31) AND C<Ref(C,-1) AND ibs<0.25;

buyPrice=Close;

Sell= ( C>Ref(H,-1) ) OR ( C>Ref(C,-1) AND Ref(C,-1)>Ref(C,-2) );

sellPrice=Close ;

 

Tradestation code:

 

If dayofmonth(date)>28 And
c < c[1] And
IFF((H-L)<>0,((C-L))/(H-L),1) < 0.25
then buy this bar at close;
If (c>h[1] or (c>c[1] and c[1] > c[2])) 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.