Hi - Here is a quick and dirty one you can try, however I am shifting an 
array backward to get the Buys so I think probably the latest buy won't show 
up until the 1st of the following month rolls around, hopefully good enough 
for a quick backtest though...

Steve

FirstDay = Day() < ref( Day(), -1 );
SecondDay = ref( FirstDay, -1 );
SixthLastDay = ref( FirstDay, 6 );
Buy = SixthLastDay;
Sell = SecondDay;


----- Original Message ----- 
From: "steve_almond" <[email protected]>
To: <[email protected]>
Sent: Wednesday, January 21, 2009 6:27 PM
Subject: [amibroker] Specifying Days of Month


>I would like to try a backtest which says:
>
> Buy at the open on the 6th last trading day of the month;
> Sell at the open on the 2nd trading day of the next month;
>
> So, for the current month:
> Buy on Jan 23, 2009
> Sell on Feb 03,2009
>
> Can anyone help me to translate that into AFL?
>
> Steve
>
>
> ------------------------------------
>
> **** IMPORTANT ****
> This group is for the discussion between users only.
> This is *NOT* technical support channel.
>
> *********************
> TO GET TECHNICAL SUPPORT from AmiBroker please send an e-mail directly to
> SUPPORT {at} amibroker.com
> *********************
>
> For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
> http://www.amibroker.com/devlog/
>
> For other support material please check also:
> http://www.amibroker.com/support.html
>
> *********************************
> Yahoo! Groups Links
>
>
>
> 


Reply via email to