Comment(iOpen) shows value of "0.0" - Is my script too fast? Or my PC / internet connection too slow?
kiikek: I need to know why this is happening.
On MT4: Unless the current chart is that specific pair/TF referenced, you must handle 4066/4073 errors
before accessing prices.
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 everyone,
I'm new to coding and have encountered a problem.
I wrote this script and compiled it with no problems.
I then open a new random chart, say AUDJPY. And then I drop the script on to the chart.
But the number being displayed is simply "0.0". See for yourself, I posted a screenshot:
A few seconds later, I close this chart. Open a new one and drop the very same script onto the chart again.

This time, it shows me a value, and a correct one at that. See screenshot:
Is there an explanation for this?
Could it be my computer being very slow? And it had to wait for a few seconds first before it was able to "pull" this piece of information from the broker? And then, when it already had this piece of info and I tried to retrieve it again, it was able to simply pull it from the history center table (F2)?
Because my computer, a notebook from 2007, is indeed super slow (I needed 387ms just to compile this simple script).
Please help, I need to know why this is happening.