Download MetaTrader 5

How to set limit for max bars in history and max bars in chars?

To add comments, please log in or register
Yun-Feng Hsieh
3488
Yun-Feng Hsieh  


Dear  Friends~

I want to put some code in the indicator about setting limit for max bars in history and max bars in chars,

Preventing  too much data loading on the chart  make CPU slow down or terminal freeze.

Even if some one set the value as 999999999999,the indicator will  optimize value to limit as ex.=>500000.

Would someone please give me some instruction?? Thanks very much!!

whroeder1
16324
whroeder1  
  1. No need for code. No need to limit max bars in history. Disk space is cheap, and you might want it in optimizer. Max bars in chart is at tools -> options > chart in MT4.
  2. If that still doesn't solve it, then have the indicator do its calculations in groups. See How to do your lookbacks correctly.
Yun-Feng Hsieh
3488
Yun-Feng Hsieh  
whroeder1:
  1. No need for code. No need to limit max bars in history. Disk space is cheap, and you might want it in optimizer. Max bars in chart is at tools -> options > chart in MT4.
  2. If that still doesn't solve it, then have the indicator do its calculations in groups. See How to do your lookbacks correctly.

In real time data loading, my indicator recalculates while changing time frame. 
I want to prevent someone set too high value in tools->options that cause terminal freeze.
but need to access new bars data.
I need a code to control max bars in chart and history, Is there any other ways?

Thanks!! 



To add comments, please log in or register