Stock Returns Around Easter Holiday (Amibroker And Tradestation Code)
The original article is found on this link.
Amibroker code:
The performance before the Easter holiday:
Buy= DayOfWeek()==5 AND Ref(DayOfWeek(),5)==1 AND (Month()==3 OR Month()==4) ;
buyPrice=Close;
Sell= DayOfWeek()==4;
sellPrice=Close ;
The performance after the Easter holiday:
Buy= DayOfWeek()==4 AND Ref(DayOfWeek(),1)==1 AND (Month()==3 OR Month()==4) ;
buyPrice=Close;
Sell= DayOfWeek()==5;
sellPrice=Close ;
Buy on the Wednesday before Holy Thursday and sell at the close on Holy Thursday:
Buy= DayOfWeek()==3 AND Ref(DayOfWeek(),2)==1 AND (Month()==3 OR Month()==4) ;
buyPrice=Close;
Sell= C>0;
sellPrice=Close ;
Tradestation code:
{
Stock Returns before Easter Holiday (strategy 99A)
See own lesson called Tradestation code for Easter holiday
}
if IsEasterHoliday(CalcDate(Date, 7)) then buy this bar on close;
if IsEasterHoliday(CalcDate(Date, 1)) then sell this bar on close;
{
Stock Returns after Easter Holiday (strategy 99B)
}
if IsEasterHoliday(CalcDate(Date, 1)) then buy this bar on close;
if IsEasterHoliday(CalcDate(Date, -7)) then sell this bar on close;
{
Stock Returns on Holy Thursday (strategy 99C)
}
if IsEasterHoliday(CalcDate(Date, 2)) then buy this bar on close;
if IsEasterHoliday(CalcDate(Date, 1)) then sell this bar on close;
