I have a set of circumstances (not defined yet), where sometimes, OnCalculateMinMax appears to not get called.
An indicator I have, that works mainly as an Overlay, will render bars on the main chart (which may be in panel 2, 3, etc.). These are scaled to around 15% of the max height, so requires OnCalculateMinMax to set that scale. On a few charts, this does not work. The bars appear full screen and are not scaled. On most charts, it works OK. I added 'Print' statements to 'Print(MaxValue);' at the end of my OnCalculateMinMax, and where it works fine, I see the values in the output window. Where is does not work, nothing gets printed and no errors are reported. It seems OnCalculateMinMax is not actually being called at all. I have added print statements to the very top, too, just in case of an error below. Nothing... All indicator settings between the 2 charts are the same and it is the same indicator on both charts. I have confirmed IsAutoScale is set to true in all cases.
From what I can see, if you add 'public override void OnCalculateMinMax()' to your code, there is not a circumstance where it will not be called? in my case, it appears this is happening though.
Any advice?
Thanks.
Comment