Limit max number of bars in history in mql5

 
Hi in mt4 i saw that max number of bars in history can change in Tools -> Options -> Charts with max bars in chart, but how can i change in mt5?, there is only max bars in chart, i could not find any answer for this in the forum as well, using all rates_total in each indicator in mql5 consumes too much cpu as i am using 25 custom indicator and copybuffer in my EA and 50 EA on each different chart. thanks.
Documentation on MQL5: Constants, Enumerations and Structures / Environment State / Client Terminal Properties
Documentation on MQL5: Constants, Enumerations and Structures / Environment State / Client Terminal Properties
  • www.mql5.com
Information about the client terminal can be obtained by two functions: TerminalInfoInteger() and TerminalInfoString() . For parameters, these...
 
aenes22346:
Hi in mt4 i saw that max number of bars in history can change in Tools -> Options -> Charts with max bars in chart, but how can i change in mt5?, there is only max bars in chart, i could not find any answer for this in the forum as well, using all rates_total in each indicator in mql5 consumes too much cpu as i am using 25 custom indicator and copybuffer in my EA and 50 EA on each different chart. thanks.

In MT5 the same. 

50 EAs is impressive indeed.

 
Oleksandr Medviediev #:

In MT5 the same. 

50 EAs is impressive indeed.


interesting. i am using metaquotes mt5 app for a try. here is a screenshot i can not find max number of bars in history, only max number of bars in chart exists:

Files:
 
This is it, max bars in chart - is your max bars in history. 
 
Oleksandr Medviediev #:
This is it, max bars in chart - is your max bars in history. 

in a topic in the forum max bars in history as i put in below, and max bars in chart is different in mt4. is it the same in mt5? i set it to 1000 but i could not see any difference in the cpu for example with setting 50000 or 30000 number of bars in chart.

Does max bar in history and chart affect to EA work?
Does max bar in history and chart affect to EA work?
  • 2020.05.27
  • Sky All
  • www.mql5.com
Dear experienced traders I have a question confused me so much, could you help me? In options we can set max bar in history and in chart...
 
aenes22346 #:

in a topic in the forum max bars in history as i put in below, and max bars in chart is different in mt4. is it the same in mt5? i set it to 1000 but i could not see any difference in the cpu for example with setting 50000 or 30000 number of bars in chart.

Restart.

 
Oleksandr Medviediev #:

Restart.

Yes i restarted before i checked. unfortunately same.
 
i tried the returned bars and yes above 1000 can not be reach as below:
int handlearray;
double arr[];
double indicatorarray;
//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
  {
//---
   
//---
   ArraySetAsSeries(arr, true);
   handlearray = iCustom(NULL,PERIOD_M5,"ind_try1");
   CopyBuffer(handlearray, 0, 0, 100000, arr);
   indicatorarray = arr[1500];
   Print(indicatorarray);
   return(INIT_SUCCEEDED);
  }

1500th element taken from the indicator could not be reached by EA ("array out of range" error happened), and yes history consists at most 1000 bar as i set the chart to 1000. but what can be the problem anything else then back history bars that affects the cpu?