#region Variables
private bool showplot = true;
private Color defaultColor = Color.Transparent; // to make line Blank initially but is overridden by showplot = true which sets it to Red.
protected override void Initialize()
{
if (showplot)
{
defaultColor = Color.Red; // to turn on line with Red Color
}
else
{
defaultColor = Color.Transparent; // to turn off line with Transparency
}
Add(new Plot(new Pen(defaultColor, 3), PlotStyle.Line, "MyPlot"));
When I compile there are no errors, so where am I going wrong?
When I load the indicator the plot lines come on as Red which tells me the first part of the "If" statement is working ok.
When I change showplot to False, the red lines should be gone by turning Transparent, but nothing happens and the Red lines stay on the chart.
What am I missing here?
Thanks
Comment