Why iBars and TerminalInfoInteger(TERMINAL_MAXBARS) return different values?

 

I used below to get number of bars in GBPNZD monthly chart, it only shows 131 bars.

int numOfBars = iBars(symbolList[i], PERIOD_MN1);
However, when I used below code to get chart's maximum bars, it shows 266 bars.
long maxbars=TerminalInfoInteger(TERMINAL_MAXBARS);


I tried to get close value at shift 180 but failed. How can I do that? (checked that bars in chart is 266.

 
Because.

https://docs.mql4.com/constants/environment_state/terminalstatus#enum_terminal_info_integer

The maximal bars count on the chart.


And iBar ()
Returns the number of bars on the specified chart.

https://docs.mql4.com/series/ibars

Get it?

 
Dominik Egert:
Because.

https://docs.mql4.com/constants/environment_state/terminalstatus#enum_terminal_info_integer

The maximal bars count on the chart.


And iBar ()
Returns the number of bars on the specified chart.

https://docs.mql4.com/series/ibars

Get it?

Thanks Dominik.

Then why I can see 266 bars on Specific chart (I only opened 1 monthly chart) but iBar() shows 131 bars?
How can I get iClose() for shift 180 for example?

Thanks.

 
Hardworking Pig:

Thanks Dominik.

Then why I can see 266 bars on Specific chart (I only opened 1 monthly chart) but iBar() shows 131 bars?
How can I get iClose() for shift 180 for example?

Thanks.

Maybe your request is related to this topic:

https://www.mql5.com/en/forum/247732

How to automatically download chart history data from server in MQL?
How to automatically download chart history data from server in MQL?
  • 2018.05.27
  • www.mql5.com
Hello all, hope this note finds you great...
 
Dominik Egert:

Maybe your request is related to this topic:

https://www.mql5.com/en/forum/247732

Great thanks to you, Dominik^^

Reason: