View Single Post
  #10 (permalink)  
Old 05-27-2007, 01:16 PM
HerbertH's Avatar
HerbertH HerbertH is offline
Member
 
Join Date: May 2006
Posts: 88
HerbertH is on a distinguished road
Quote:
Originally Posted by european
if init() executes only once when EA started then it is of no use if one wants an EA to resume working say in 10 minutes.

Unfortunately there is also a problem with OrderCloseTime() when a new tick happens immediately after an order was closed.

euro
Init() is only used to initialize the variables. This is intended to only be executed once.
To use this mechanism for shorter periods of restart time you could use the lower bartime like 15 or 30 minutes. e.g. iTime(NULL,PERIOD_M15,0)

For the OrderCloseTime() you are right; when just before the bar changes, the order is closed.
This depends however on how "next period" is defined.
If you want to restart at 24:00 just use the daily bar.
If you want to restart 24 hours after the last order was closed, then use 24 "hour-bars"

Cheers
__________________
Better being out wishing to be in, than being in wishing to be out.....
Reply With Quote