look at your setting and see what timenum should specifiy, the beginning of the
bar or the end of the bar.
Rajiv
To: amibro...@yahoogroups.comfrom: skbi...@yahoo.comdate: Thu, 29 Jan 2009
17:04:20 -0800Subject: [amibroker] RE: intraday time control
The one strange thing that occurs
The one strange thing that occurs in the previouse code is the exit time. I
want to exit @ 1245 but with 15 min bars setting exittime to >=1244 results in
an exit at 1300 so I had to use the previous 15 min bar and set exittime to
1229...
Not sure I understand why that happens.
Sid
Thanks Ed, Rajiv, Barry:
Taking a little from each of you I think the final solution looks like this:
starttime = 063000;
endtime = 122900;
// Use for backtesting
tradetime = TimeNum() >= starttime AND TimeNum() <= endtime;
exittime = TimeNum() >= 122900;
// use for real time trading
//trad
Sid, you are correct to use Now(4) or system time. If you use bar
time and there is no tick you will not close the trade when you
expect. AFL scans your code when a tick comes in. If a tick does not
come in at the end of the bar then you will not trade when you expect.
When you exit make sure y