Australian (ASX) Stock Market Forum

Amibroker AFL - How to skip list of dates?

Joined
8 March 2011
Posts
6
Reactions
0
I have noticed that one of my systems performs only negatively on FCO date and the day before FCO. So in order to backtest this system more accurately I would like to skip trading on these dates. As selecting the days to skip cannot be automated I would like to include a manually entered list of these non-trading dates in my AFL and for Buy and Short triggers to be ignored should they fall on any of the dates in the list.
Any pointers or examples would be appreciated.
Thanks
 
I have noticed that one of my systems performs only negatively on FCO date and the day before FCO. So in order to backtest this system more accurately I would like to skip trading on these dates. As selecting the days to skip cannot be automated I would like to include a manually entered list of these non-trading dates in my AFL and for Buy and Short triggers to be ignored should they fall on any of the dates in the list.
Any pointers or examples would be appreciated.
Thanks

An example below:
Code:
nobuy1 = DateNum()!=1110322;//no buy signals on 22/3/2011
nobuy2 = DateNum()!=1110323;//no buy signals on 23/3/2011

nobuy = nobuy1 AND nobuy2;

Buy = [I]your buy criteria[/I] AND nobuy;
It's handy to keep your "nobuy" code as a separate AFL in the include folder and then call it in your main AFL as an include. Add dates by adding "nobuy3" "nobuy4" etc.
 
Thanks Captain. That fixed it. System backtest performance also improved more dramatically than expected.
 
Top