Christmas/Santa Claus Rally In Gold (Gold Seasonality) (Amibroker And Tradestation Code)
The original article can be found here.
The logic in plain English:
- We buy at the close of the OPEX Friday in December,
- and we sell at the close of the first trading day of the new year.
Amibroker code:
SetOption("initialEquity",100000);
SetPositionSize(99.75*leverage,spsPercentOfEquity);
setOption("holdminbars",1);
SetTradeDelays( 0, 0, 0, 0 );
Buy= DayOfWeek()==5 AND Day()>14 AND Day()<22 AND Month()==12 ;
buyPrice=Close;
Sell= Month()==1;
sellPrice=Close ;
Tradestation code:
if dayofweek(date)=5 and dayofmonth(date)>14 and dayofmonth(date)<22 and month(date)=12 then
buy this bar on close;
if month(date)=1 then
sell this bar on close;
