Richard Read: However if that chart is closed, the data is more often than not inaccurate.
On MT4: Unless the current chart is that specific pair/TF referenced, you must handle 4066/4073 errors.
Download history in MQL4 EA - MQL4 and MetaTrader 4 - MQL4 programming forum

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 there,
I am trying to get indicator data from a chart other than the one that I have my EA/Indicator/Script active on. The problem is, if that chart is currently open, the data is accurate. However if that chart is closed, the data is more often than not inaccurate.
I am testing this using the following script:
Say I have not accessed "USDTHB" for a long time, and I have the chart currently closed.
The first time I run the script, I get the following info:
It will return 0 hundreds of times...
However, if I immediately run the script again:
It produces a value the first time.
So somewhere between the first and second attempts of the script, the chart data for USDTHB updated, allowing me to get data on the second run.
My question is, is there a way I can "force" this update of information, to ensure that I can get values n the first run?
Thanks in advance.
Richard