
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Thanks guys, I think I see a way to make this work for me now. If I use iOpen() calls then I need to trap for error 4066 and sleep while giving the server time to update the memory-resident hst data before attempting to call iOpen() again. Thanks for all your help.
Do you guys think putting the following code snippet in my init file will serve well enough to call the history data from the server for all timeframes on the related Symbol()?
By putting it in init() does this mean I don't have to be worried about the iClose/iOpen/etc calls ever generating a time-synch error later on in the start() routine? The timeframes are all being perpetually updated by the terminal because the iClose() call was made once already during init()?
Firstly, it might be a good idea to download M1 only and build all other time-frames from it (with your automated tool) to avoid 'unmatched data error' while testing.
Secondly, I was under the impression that 'forcing' bars to download with this method doesn't work. I don't remember how I reached this conclusion, it was a long time ago. I have searched and the only relevant threads I can come up with are these: https://www.mql5.com/en/forum/103958, https://www.mql5.com/en/forum/123755.
Anyway I hope this does work... Let us know. The code seems fine btw.
When running tester in auto configuration mode, tester starts very quickly and even the account is not activated yet. It takes few seconds for an account to activate in the mean time tester has already performed some testing which generate in valid results. Does any one has idea how to add the delay in tester. Or does any one know why the results of tester using manual (starting the tester manually) is different than the ones which are obtained using auto config for the tester. Please help. Thanks.
in the meantime the only way i managed to do this, is by using WINAPI
Firstly, it might be a good idea to download M1 only and build all other time-frames from it (with your automated tool) to avoid 'unmatched data error' while testing.
Secondly, I was under the impression that 'forcing' bars to download with this method doesn't work. I don't remember how I reached this conclusion, it was a long time ago. I have searched and the only relevant threads I can come up with are these: https://www.mql5.com/en/forum/103958, https://www.mql5.com/en/forum/123755.
Anyway I hope this does work... Let us know. The code seems fine btw.
That's my plan, was just making the generic case that is applicable to all standard timeframes.
It works by the way, but only pulls 2048 bars (if that many are available) for each timeframe.
This is the code I use to programmatically refresh the M1 chart (which after refreshing I will then period convert and fileflush all period data including the M1 for subsequent file transfers to my auto-optimizers):
When I do that trick of making a dummy time-zero (1970) candle in the hst files then this code in my init pulls up to 65,560 bars from the server (if available).
Thanks again for all the assistance and pointers :)
Do you guys think putting the following code snippet in my init file will serve well enough to call the history data from the server for all timeframes on the related Symbol()?
By putting it in init() does this mean I don't have to be worried about the iClose/iOpen/etc calls ever generating a time-synch error later on in the start() routine? The timeframes are all being perpetually updated by the terminal because the iClose() call was made once already during init()?
BTW, for the record I can confirm that once you make an iClose() call in the init routine, or elsewhere, provided the calling EA/chart remain active (say the chart is M1, but iClose is called on M5) then the M5 data will continue to be updated behind the scene for the duration until the terminal/chart/ea are closed.
BTW, for the record I can confirm that once you make an iClose() call in the init routine, or elsewhere, provided the calling EA/chart remain active (say the chart is M1, but iClose is called on M5) then the M5 data will continue to be updated behind the scene for the duration until the terminal/chart/ea are closed.
I probe this code.
But I don't use it.
The Sleep(sleep_seconds*1000); function is not runing. Not sleep!
Why?
In the documentation: "The Sleep() function cannot be called from custom indicators since they calculate in the interface thread and may not decelerate it."
What is it?
use the "loop" sleep method.
***
use the "loop" sleep method.
***