I have searched and cannot seem to find a reference. Is there a API or variable that I can utilize that will tell me if my strategy code is displaying visually rather than comuting values for either optimization or the strategy monitor?
Size:
Color:
There is a possibility to tell Strategy Monitor from Strategy Window by using either the IsPricePane or ChartStyle properties (QuickRef for more).
Size:
Color:
From what I read, either of your recommendations works for strategy monitor. What about when I am running an Optimization vs. the Strategy Window?
Size:
Color:
Why would you need that?
Size:
Color:
For example, I often have Bollinger Bands and Moving Averages on my charts when I am looking at a stock, but if I am running an optimization, I would like to avoid any unnecessary work to expidite the results.
Size:
Color:
The Optimizer is smart enough to not let such activity slow processing down. If you run the QuickRef code snippet of ChartStyle under Optimization, it will tell you that it's running in "Strategy Monitor" mode - or to be precise, in a context where there is no chart, so null is returned. No plotting happens in Optimization/Strategy Monitor mode, but you still may use the code to detect Optimizer runs.
Size:
Color:
It would seem that the optimizer would not know if the Bollinger Band was being used and as a result would always calculate the series for each iteration of the testing.
Size:
Color:
It shouldn't, unless you defined the series outside the "if( ChartStyle != null )" block.
Size:
Color: