how to refresh symbol data - page 3

To add comments, please log in or register
whroeder1
17929
whroeder1  
Dua Yong Rew:

I have a script to scan candlestick pattern on multiple symbols. When I run the script in the morning, it always gives me candlestick pattern the day before.

After I run it again, it gives me today's pattern. Seems that the first run did not download the symbols price data.

How do I force download all symbols data in script?

The first time you run and try to access another symbol/timeframe

  1. Clear _LastError
  2. Try to access
  3. Check the error codes for 4066/4071 Then sleep for 5 seconds to let the terminal time to download new data, then retry.
Runtime Errors - Codes of Errors and Warnings - Standard Constants, Enumerations and Structures - MQL4 Reference
Runtime Errors - Codes of Errors and Warnings - Standard Constants, Enumerations and Structures - MQL4 Reference
  • docs.mql4.com
Runtime Errors - Codes of Errors and Warnings - Standard Constants, Enumerations and Structures - MQL4 Reference
Dua Yong Rew
5505
Dua Yong Rew  
Trinh Dat:
Maybe, but try to delete it from code above then you see problem.
I removed refreshrates and caught in a endless loop
Dua Yong Rew
5505
Dua Yong Rew  
whroeder1:

The first time you run and try to access another symbol/timeframe

  1. Clear _LastError
  2. Try to access
  3. Check the error codes for 4066/4071 Then sleep for 5 seconds to let the terminal time to download new data, then retry.

I'm getting error 4066

But how do I use this get last error in my code? 

whroeder1
17929
whroeder1  
Dua Yong Rew: But how do I use this get last error in my code? 
What part of "check, sleep, and retry" was unclear?
123
To add comments, please log in or register