I'm new to Amibroker and would like to test a system that buys on the close of 
the first trading day of the week and sells on the close of the last trading 
day of that same week.

Something like this would work if there are no holidays-
buy= dayofweek()==1; // buy on Monday
sell= dayofweek()==5; //sell on Friday

But his logic fails when there are holidays. The NYSE is closed on Good Friday. 
So the system should sell on Thursday.

And if Monday is a holiday, it should buy on Tuesday.

Is there any way to do this without coding a long list of holiday exceptions 
with specific days? I would want to avoid having to do this.

buy= (dayofweek()==1) OR (datenum==exception1) OR (datenum==exception2) ..... 

Reply via email to