Valentine’s Day Rally (Amibroker And Tradestation Code)
The original code can be found here.
The logic in plain English:
- The month is February.
- We buy at the close on the tenth calendar day (or later if a non-trading day).
- We sell at the close on the 14th of February or the next trading day.
Amibroker code:
Buy= Day()>=10 AND Day()<14 AND Month()==2 ;
buyPrice=Close;
Sell= Day()>=14;
sellPrice=Close ;
Tradestation code:
{
Strategy - Valentine’s Day Rally
https://www.quantifiedstrategies.com/lessons/valentines-day-rally-amibroker-code/
}
if Month(Date) = 2 AND Dayofmonth(Date) >= 10 AND Dayofmonth(Date) < 14 Then
Buy this bar on close;
if Month(Date) = 2 AND Dayofmonth(Date) >= 14 Then
Sell this bar on close;
