My EA seems to be in a loop! Help please! - page 3 123 New comment Simon Gniadkowski 2013.08.15 08:35 #21 szgy74: Can you please show me a working example of 4066 checking? I have several problems with the update of missing history data but NEVER got the 4066 (with GetLastError), I tried many places (in the code). Read here: https://www.mql5.com/en/forum/143422 and here https://www.mql5.com/en/forum/145905 . . . And from here: http://www.forexfactory.com/showthread.php?t=438824 int GLError = 0; GLError = 4066; while(GLError == 4066) { iOpen("AUDCAD",15,0); iHigh("AUDCAD",15,0); iLow("AUDCAD",15,0); iClose("AUDCAD",15,0); GLError = GetLastError(); if(GLError == 4066) Sleep(15000); } szgy74 2013.08.15 08:53 #22 RaptorUK: Read here: https://www.mql5.com/en/forum/143422 and here https://www.mql5.com/en/forum/145905 . . . And from here: http://www.forexfactory.com/showthread.php?t=438824 Thank you, I will read and try these. William Roeder 2013.08.15 13:26 #23 szgy74: Can you please show me a working example of 4066 checking? I have several problems with the update of missing history data but NEVER got the 4066 (with GetLastError), I tried many places (in the code). You won't get 4066 unless you shut down the terminal and delete the history files. Instead of using ACR you can use iTime() same result ArrayCopyRates(m1.acr, market.pair, PERIOD_M1); // I'm in an OnInit. //} } // OnInitAnalyze : if(m1.acr[0][ACR_TIME] == 0.){ // Verify M1 data. int gle = GetLastError(); if (gle != ERR_HISTORY_WILL_UPDATED){ DisableTrading("No M1 history: " + GetLastError()); return; } Print("Updating history for M1 chart"); Sleep(15000); RefreshRates(); if(m1.acr[iCB][ACR_TIME] == 0.){ DisableTrading("Updating history for Minute chart failed: " + GetLastError()); return; } Print("Updating history for Minute chart Succeeded"); } // M1 data szgy74 2013.08.15 15:31 #24 WHRoeder: You won't get 4066 unless you shut down the terminal and delete the history files. Instead of using ACR you can use iTime() same result Thank you, I will try this too. 123 New comment
Can you please show me a working example of 4066 checking?
I have several problems with the update of missing history data but NEVER got the 4066 (with GetLastError), I tried many places (in the code).
Read here: https://www.mql5.com/en/forum/143422 and here https://www.mql5.com/en/forum/145905 . . .
And from here: http://www.forexfactory.com/showthread.php?t=438824
Read here: https://www.mql5.com/en/forum/143422 and here https://www.mql5.com/en/forum/145905 . . .
And from here: http://www.forexfactory.com/showthread.php?t=438824
Thank you, I will read and try these.
Can you please show me a working example of 4066 checking?
I have several problems with the update of missing history data but NEVER got the 4066 (with GetLastError), I tried many places (in the code).
Thank you, I will try this too.