You asked for the time of a nonexistent bar; you got zero and set _LastError.
- You haven't downloaded M1 history.
- Your assumption is that history magically appears.
-
On MT4: Most brokers only have 32 or 65K bars of history per timeframe. That's 45 days of M1, 2.5 years on M15, etc.
-
Quickly DL all available history from your broker: Problem loading historical data - MQL4 programming forum (2010)
-
Is there any way to load programmatically entire history (of a Symbol and a Period) from server? - MQL4 programming forum #8 (2020) MT5 - Multi-Currency Indicator in Tester - Technical Indicators - MQL5 programming forum #3 (2018)
Otherwise, you will have to download history from elsewhere. MT4 history: How to Start with Metatrader 5 - General - MQL5 programming forum - Page 94 #932 (2017)
-
Thank you for the information. I read it and I believe I obtained some more bar data.
The highest number of M1 bars I can get now is 251500 so I chose:
H1 = 4,000 barsM15 = 16,000 bars
M1 = 240,000 bars
The results:
H1: 4000 bars since 2022-3-10
M15: 16000 bars since 2022-3-10 Yes! It matches! :-)
M1: 240000 bars since 2020-12-11 Noooo! :-(
I could forgive one or two days off, but not one year and three months!
Why does this happen?
The results: H1: 4000 bars since 2022-3-10, M15: 16000 bars since 2022-3-10 Yes! It matches! :-), M1: 240000 bars since 2020-12-11 Noooo! :-(, I could forgive one or two days off, but not one year and three months! Why does this happen?
Assuming no intra-day gaps, then 240000 M1 bars = 166.6 days = 33.3 weeks (5 day weeks).
However since there are ALWAYS intra-day and inter-day gaps, then time can be off quite a lot.
So, don't just assume the counting M1 bars will be equivalent to counting minutes of time.
Yes, I have. I followed the tip shared in one of the links you provided and acquired more data.
But there are discrepancies.
Anyway, I gave up on the idea of analyzing the exact same period in every timeframe.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
I want to collect some historical data:
The log says:
1000 bars since 2022-9-12
Then I changed that to this:
1,000 bars in H1 equals 60 times as many bars in M1, right? 1,000 * 60 = 60,000.
But the log says:
60000 bars since 1970-1-1
Great Scott! That's not what I want. I was fully expecting to go back as far as 2022-9-12 again.
What did I do wrong?