I'm trying to have the ability to customize the overbought and oversold lines from the indicator window but am experiencing some difficulty. The code I've tried is as follows:-
#region Variables
int overbought = 45;
int oversold = -45;
protected override void Initialize()
{
Add(new Line(System.Drawing.Color.DarkViolet, overbought, "Upper"));
Add(new Line(System.Drawing.Color.LightBlue, oversold, "Lower"));}
#region Properties
[Description("Overbought Level")]
[Category("Parameters")]
public int Overbought
{
get { return overbought; }
set { overbought = Math.Max(1, value);}
}
[Description("Oversold Level")]
[Category("Parameters")]
public int Oversold
{
get { return oversold; }
set { oversold = Math.Max(1, value);}
}
Regards
Kay Wai

Comment