[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[amibroker] [Backtesting] Going long/short on a particular date - problem with weekends



PureBytes Links

Trading Reference Links

Hi, I have futures EOD data and I'm trying to go long on a particular day. So far I have this

Buy =  Day() == 29 AND Month() == 1;
Sell = Day() == 14 AND Month() == 2;

The problem is when I enter on 1/29 and suppose 2/14 is holiday or weekend, Sell command won't be executed because OHLC is not defined for weekends so these days are skipped by AB during testing. How can I handle these cases? How can I find closest trading day (the next or previous one) when to leave or enter if the date I want to enter/leave is weekend?

I was going through the forums and few guys were struggling with similar issue and they were told that one possible solution might be to edit EOD files and put there dummy values for weekends and fill OHLC with "-1" or something. Then in a to code check Close value and if it is "-1" that day is weekend or holiday and then with use of "Ref" one can skip back and forward to look for the first trading day.

imo this might work, but is there any better way. Thanks



------------------------------------

**** IMPORTANT PLEASE READ ****
This group is for the discussion between users only.
This is *NOT* technical support channel.

TO GET TECHNICAL SUPPORT send an e-mail directly to 
SUPPORT {at} amibroker.com

TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
http://www.amibroker.com/feedback/
(submissions sent via other channels won't be considered)

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/amibroker/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/amibroker/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:amibroker-digest@xxxxxxxxxxxxxxx 
    mailto:amibroker-fullfeatured@xxxxxxxxxxxxxxx

<*> To unsubscribe from this group, send an email to:
    amibroker-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/