I'm developing a custom indicator which is based on the main chart (a very small timeframe), and another added DataSeries which stays hidden (This second data series has a significantly bigger time frame than the first one).
I noticed while developing than the results from certain calculations had problems, some values returned unexpected outputs. After trying different things, I found out that the problem was caused due to the Days/Bars to load configured. Somehow, due to the added data series being significantly bigger than the other timeframe, I had to load a lot of bars to make the calculations work correctly.
E.g. if I load 1500 Bars in the chart, the output is incorrect, but when loading 15000 Bars, it works perfectly (without the code being modified).
Quick note: Loading this amount of bars did not affect performance on an old laptop which I also tried just to make sure.
So my question here is: Is there any way to change/set the Days or Bars to load from inside an indicator? I would like to do this just to make sure that no matter the user input, the needed amount of bars will be loaded so that the indicator works correctly.
Thanks in advance!

Comment