olympus999 :
Using the following code i am trying to download as much history i can or 3000 bars from this moment is downloaded.
If i delete all my previous history files it works great. To make sure it works great, sometimes i use "Sleep(10000)" inside the second for loop to ensure enough time for downloading information.
Like i said, it works without problems.
But if i already have history files in the folder it dose not work so great. From 1 minute to weekly i have roughly 8 months of history of 62 currency pairs.
When i have this history in my history folder and run this EA, MT4 always crashes. I have tried several things, i tried to add long pauses, i tried to automatically remove EA and re-attach after every currency pair. Nothing worked.
But if i rune the same code i have displayed here and MT4 crashes and i reopen MT4 it magically starts to download all the historical data, but with some mistakes. It download most of history, but not all. Once it only did not download 1 currency pair's 5 minute bars.
I noticed when my MT4 is starting to crash in the connection bar, the upper green one goes light green every time just before the crash. Are there any ideas how i could download all the data without crashing or does anybody have any idea why MT4 crashes?
init() is not supposed to run for a long time . . . move your loop to start() and run your code as a script.
Using the following code i am trying to download as much history i can or 3000 bars from this moment is downloaded.
If i delete all my previous history files it works great. To make sure it works great, sometimes i use "Sleep(10000)" inside the second for loop to ensure enough time for downloading information.
Like i said, it works without problems.
But if i already have history files in the folder it dose not work so great. From 1 minute to weekly i have roughly 8 months of history of 62 currency pairs.
When i have this history in my history folder and run this EA, MT4 always crashes. I have tried several things, i tried to add long pauses, i tried to automatically remove EA and re-attach after every currency pair. Nothing worked.
But if i rune the same code i have displayed here and MT4 crashes and i reopen MT4 it magically starts to download all the historical data, but with some mistakes. It download most of history, but not all. Once it only did not download 1 currency pair's 5 minute bars.
I noticed when my MT4 is starting to crash in the connection bar, the upper green one goes light green every time just before the crash. Are there any ideas how i could download all the data without crashing or does anybody have any idea why MT4 crashes?
Did not work. Exactly the same problem, but with script it did not download almost no data at all...
olympus999 :
Did not work. Exactly the same problem, but with script it did not download almost no data at all...
Exactly the same problem as ? you described a few failure modes . . . did it crash MT4 ?
Did not work. Exactly the same problem, but with script it did not download almost no data at all...
WHRoeder :
- Did you move it out of init?
- Did you check for ma1==0 AND GetLastError()=4066
AND sleep 15 seconds before continuing?ERR_HISTORY_WILL_UPDATED 4066 Requested history data in updating state. - Did you install in \program files* on Vista/7/8?
I did 1 and 2 now, worked marvelously. Thank you :)

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
If i delete all my previous history files it works great. To make sure it works great, sometimes i use "Sleep(10000)" inside the second for loop to ensure enough time for downloading information.
Like i said, it works without problems.
But if i already have history files in the folder it dose not work so great. From 1 minute to weekly i have roughly 8 months of history of 62 currency pairs.
When i have this history in my history folder and run this EA, MT4 always crashes. I have tried several things, i tried to add long pauses, i tried to automatically remove EA and re-attach after every currency pair. Nothing worked.
But if i rune the same code i have displayed here and MT4 crashes and i reopen MT4 it magically starts to download all the historical data, but with some mistakes. It download most of history, but not all. Once it only did not download 1 currency pair's 5 minute bars.
I noticed when my MT4 is starting to crash in the connection bar, the upper green one goes light green every time just before the crash. Are there any ideas how i could download all the data without crashing or does anybody have any idea why MT4 crashes?