I have had no problem plotting back colors with opacity and adjusting the opacity in the Menu Panel by having opacity as a public int.
But when pasting that code over to the indicator, it sort of works and sort of doesn't. What happens is the line is indeed plotted with opacity. But changing the opacity value in the Menu Panel makes no difference, even though the exact same code works with Back Color opacity.
The only way I can change the opacity is to go back into the code and change the value in the Variables Menu. So if I change it from 15 - 150 in the Variables menu, the colors harden up, i.e. become much more opaque. But if I change the opacityvalue in the Menu Panel from 15 - 150, nothing happens.
The Colors display in the drop down menu in argh numbers in the Custom Section whilst at the same time there are menu panel options for changing the color up and color down as specified in the code, which colors are supposed to be the ones for the indicator plots. Obviously I am doing something wrong but I have no idea what.
Here is some of the code showing what I have written:
#region Variables
private int period = 9;
private double fct = 10; // will be divided by 1000 so that each whole number = .001;
private Color colorup = Color.Gold;
private Color colordown = Color.SteelBlue;
private Color colorside = Color.Lime;
private int opacityValue = 125;
#endregion
/// <summary>
/// This method is used to configure the indicator and is called once before any bar data is loaded.
/// </summary>
protected override void Initialize()
{
// Add one plot for every color you wish to use.
Add(new Plot(new Pen(Color.FromArgb(opacityValue, colorup),7), PlotStyle.Line, "Rising"));
Add(new Plot(new Pen(Color.FromArgb(opacityValue, colordown),7), PlotStyle.Line, "Falling"));
Add(new Plot(new Pen(Color.FromArgb(opacityValue, colorside),7), PlotStyle.Line, "Neutral"));
+++ and in the Properties Section:
[Description("Colorup")]
[Category("Visual")]
[Gui.Design.DisplayName ("ColorUp")]
public Color Colorup
{
get { return colorup; }
set { colorup = value; }
}
[Browsable(false)]
public string ColorupSerialise
{
get { return Gui.Design.SerializableColor.ToString(colorup); }
set { colorup = Gui.Design.SerializableColor.FromString(value); }
}
[Description("Colordown")]
[Category("Visual")]
[Gui.Design.DisplayName ("ColorDown")]
public Color Colordown
{
get { return colordown; }
set { colordown = value; }
}
[Browsable(false)]
public string ColordownSerialise
{
get { return Gui.Design.SerializableColor.ToString(colordown); }
set { colordown = Gui.Design.SerializableColor.FromString(value); }
}
[Description("Colordown")]
[Category("Visual")]
[Gui.Design.DisplayName ("ColorDown")]
public Color Colorside
{
get { return colorside; }
set { colorside = value; }
}
If I change the Colorup from a blue to a red, nothing happens. It can only be changed in the Plot menu and the Opacity value never makes any difference from the Menu Panel, only from the source code.
Attached: pic of Menu Panel showing the Color Options and Plot Color options duplicated in two separate series.
What am I doing wrong here so that I can adjust the Line Opacity in the Menu Panel and get it right easily?
Comment