I have used OnCalculateMinMax() in an indicator and it works fine. I am now trying to use that code in a strategy and can’t get it to work. Is OnCalculateMinMax() able to be used in a strategy?
Thanks
I have used OnCalculateMinMax() in an indicator and it works fine. I am now trying to use that code in a strategy and can’t get it to work. Is OnCalculateMinMax() able to be used in a strategy?
Thanks
I would think so, although I’ve never use it myself. StrategyRenderBase seems to define OnCalculateMinMax() and the IsAutoScale property. You may need to explicitly set IsAutoScale=true. The docs are unclear about it’s behavior in a strategy and it must be true for OnCalculateMinMax() to be called.
I would also expect your strategy needs to be attached to a chart and not running headless. Strategy analyzer behavior could be weird, I’m not sure if you actually get a chart until after the strategy has run (semi-headless?).
Hope that helps!
I have it working but the scaling seems odd, I’ll keep playing with it