TERMINAL_MAXBARS is not the correct way to determine how many bars are available in the timeseries because it returns the settings property and not the number of bars. The actual number of bars can vary significantly from TERMINAL_MAXBARS.
If you plan on copying all available data to an array then use this:
MqlRates r[]; int total = CopyRates(_Symbol, PERIOD_CURRENT, 0, INT_MAX, r); printf("%d bars copied", total);
If you just want to check how many bars are available then you should use:
total = (int)SeriesInfoInteger(_Symbol, PERIOD_CURRENT, SERIES_BARS_COUNT); printf("%d bars reported by platform", total);
TERMINAL_MAXBARS is not the correct way to determine how many bars are available in the timeseries because it returns the settings property and not the number of bars. The actual number of bars can vary significantly from TERMINAL_MAXBARS.
If you plan on copying all available data to an array then use this:
If you just want to check how many bars are available then you should use:
Thank you!
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
How can I get the ArraySize of some Symbol MqlRates?
Tks