[Description("ATR bars")]
[GridCategory("Parameters")]
public int Atr_bars
{
get { return atr_bars; }
set { atr_bars = value; }
}
I also added private initialization for the new parameter following the example:
private int atr_bars = 200; // Default atr bars
These show up when a add the strategy to the chart, and they take the parameter values I enter, however, there are some anomalies. When there was a Math.Min(10, value) in the code, then it behaved as though it was a Math.Max(10, value). It would basically fix values for parameters but not to what I expected. So I took out all Max and Min calls and then it at least accepted my inputs. Is there something else hidden that does a parameter bounds check?
Also, it appears whenever I enable the strategy that the parameters are then grayed out. If I disable the strategy, thinking I would then be able to change parameters, then they stay grayed out. I have to remove and add a new version of the strategy. Is that expected behavior?
Comment