Here is a simple method, to buy 5 days before and sell 5 days after

m = month()!=ref(month(),-1);

buy = ref( m, 5 );
sell = ref( m, -5 );


--
Cheers
Graham
AB-Write >< Professional AFL Writing Service
Yes, I write AFL code to your requirements
http://www.aflwriting.com


On 05/12/06, KBGlenn <[EMAIL PROTECTED]> wrote:

I am trying to backtest a system whereby you find the last trading day
of the month and then buy x days before that and sell y days after it.
I've tried everything I can think of but I have not been unable to
figure out how to get around days where the market is not open.  I've
been focused on the dayofyear, month, day, and dayofweek function, but
I can't seem to break the code.

Could someone please give me a point on this one?

Thank you.



Please note that this group is for discussion between users only.

To get 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