Tell if Strategy is running in Strategy Monitor or Optimization?
Author: bgood
Creation Date: 9/29/2009 10:46 AM
profile picture

bgood

#1
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?
profile picture

Eugene

#2
There is a possibility to tell Strategy Monitor from Strategy Window by using either the IsPricePane or ChartStyle properties (QuickRef for more).
profile picture

bgood

#3
From what I read, either of your recommendations works for strategy monitor. What about when I am running an Optimization vs. the Strategy Window?
profile picture

Eugene

#4
Why would you need that?
profile picture

bgood

#5
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.
profile picture

Eugene

#6
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.
profile picture

bgood

#7
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.
profile picture

Eugene

#8
It shouldn't, unless you defined the series outside the "if( ChartStyle != null )" block.
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).