I have an indicator that draws a coloured region beteen Bollinger Band upper and lower series. I set the colour and opacity of the shaded region (and also the Bollinger Band parameters) via input parameters.
When I use the indicator on a chart with settings different from the defaults, all is OK until I close the workspace and re-open it. The colour reverts to the default colour even though the opacity and Bollinger Band parameters are remembered.
How do I get the setting for region colour to persist?
Cheers
Tony
Here are sections from the code:
private double numStdDev = 2;
private int period = 14;
private Color shadeColour = Color.CornflowerBlue;
private int shadeOpacity = 2;
...
protected override void OnBarUpdate()
{
DrawRegion( "Area", CurrentBar, 0, Bollinger( numStdDev, period ).Upper, Bollinger( numStdDev, period ).Lower,
shadeColour, shadeColour, shadeOpacity );
}
...
[XmlIgnore()]
[Description("Colour of the shading.")]
[GridCategory("Parameters")]
public Color ShadeColour
{
get { return shadeColour; }
set { shadeColour = value; }
}
Comment