Michal_Jurnik:
See CheckLoadHistory() script on this page
Hi guys,
I have a problem in my custom indicator. I call CopyRates function for different currency pairs in one time (EURUSD, USDCAD, ... ) with count demand of actual chart and timeframe. In case I've never opened chart with USDCAD (as example), CopyRates always returns -1 and GetLastError function returns 4401. My question is - Is it possible to send request to server without opening all charts for each currency pair? Thank you for reply!
Documentation on MQL5: Timeseries and Indicators Access / Organizing Data Access
- www.mql5.com
Timeseries and Indicators Access / Organizing Data Access - Reference on algorithmic/automated trading language for MetaTrader 5
angevoyageur:
See CheckLoadHistory() script on this page
See CheckLoadHistory() script on this page
Thank you for reply, I'm a little bit closer. The problem is it that I haven't data when I need them. I have zero data count for every currency pair except I have already displayed. There're two options how to execute the indicator:
- In case of work-day is everything ok because market is opened (there are a lot of ticks).
- First tick check the history (CopyRates has been executed)
- If it is loaded then indicator will draw chart properly
- If it isn't then indicator will send request to server
- Next tick indicator will draw chart properly
- In case of weekend there's only one tick:
You should see my problem now. I can't use Sleep() in main thread and cycles aren't good idea.
- First tick check the history (CopyRates has been executed)
- If it is loaded then indicator will draw chart properly
- If it isn't then indicator will send request to server
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
Hi guys,
I have a problem in my custom indicator. I call CopyRates function for different currency pairs in one time (EURUSD, USDCAD, ... ) with count demand of actual chart and timeframe. In case I've never opened chart with USDCAD (as example), CopyRates always returns -1 and GetLastError function returns 4401. My question is - Is it possible to send request to server without opening all charts for each currency pair? Thank you for reply!