I am currently trying to take baby steps in the world of MQL4. I am trying to load a very small amount of data into an array using:
If I do this using PERIOD_M15 I just get a loop of count = -1 and a 4073 error. If I use PERIOD_H4 it works fine. The M15 chart displays OK, so the data is clearly there. Why does this not work?
Your code looks fine, and i run it on my mt4 without any problem.
Regardless, this simply highlights the need to always check the return values / errors before continuing... because some times the system just needs more time.
- Please edit your (original) post and use the CODE button (Alt-S)! (For large amounts of code, attach it.)
General rules and best pratices of the Forum. - General - MQL5 programming forum
Messages Editor - scoll01: count=CopyRates("GBPUSD",PERIOD_M15,0,10,test);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 - Forex Calendar - MQL4 programming forum - Page 3 #26 № 4The function linked to, opens a hidden chart for the symbol/TF in question (if not already open,) thus updating history, and temporarily placing the symbol on Market Watch (if not already there,) so SymbolInfoDouble(symbol, SYMBOL_BID) or MarketInfo(symbol, MODE_BID) don't also return zero the first call.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi All,
I am currently trying to take baby steps in the world of MQL4. I am trying to load a very small amount of data into an array using:
If I do this using PERIOD_M15 I just get a loop of count = -1 and a 4073 error. If I use PERIOD_H4 it works fine. The M15 chart displays OK, so the data is clearly there. Why does this not work?
Thanks.