I am translating and indicator from NT7 to NT8 and I am almost done (after some efforts).
I have still only one small issue to translate in order to have it t 100%, i hope someone could help me.
Here the original NT7 code
protected override void Initialize() { Overlay = true; Add(new Plot(new Pen(valueColor, 2), PlotStyle.Line, "Value")); Add(new Plot(new Pen(angleColor, 2), PlotStyle.Line, "Angle")); Add(new Plot(new Pen(triggerColor, 2), PlotStyle.Line, "Trigger")); } //ENDInitialize protected override void OnStartUp() { switch(view) // { case Views.Indicator: { Plots[0].Pen=new Pen(Color.Lime); Plots[1].Pen = new Pen(Color.Transparent); Plots[2].Pen = new Pen(Color.Transparent); } break; case Views.Trigger: { Plots[0].Pen=new Pen(Color.Transparent);Plots[1].Pen = new Pen(Color.Transparent); Plots[2].Pen = new Pen(Color.Lime); } break; case Views.Angle: { Plots[0].Pen=new Pen(Color.Transparent);Plots[1].Pen = new Pen(Color.Lime); Plots[2].Pen = new Pen(Color.Transparent); } break; } if (view!=Views.Indicator||indicate==Indicates.RSI) ScaleJustification=ScaleJustification.Left; else ScaleJustification=ScaleJustification.Right; }//ENDOnStartup
Here my attemps to translate
protected void Initialize(){ .... // Adds a plot to our NinjaScript Indicator IsOverlay = true; AddPlot(new Stroke(Brushes.Blue), PlotStyle.Line, "Value"); AddPlot(new Stroke(Brushes.Transparent), PlotStyle.Line, "Angle"); AddPlot(new Stroke(Brushes.Transparent), PlotStyle.Line, "Trigger"); switch(view) { case Views.Indicator: { PlotBrushes[0][0] = Brushes.Lime; PlotBrushes[1][0] = Brushes.Transparent; PlotBrushes[2][0] = Brushes.Transparent; } break; case Views.Trigger: { PlotBrushes[0][0] = Brushes.Transparent;PlotBrushes[1][0] = Brushes.Transparent; PlotBrushes[2][0] = Brushes.Lime; } break; case Views.Angle: { PlotBrushes[0][0] = Brushes.Transparent;PlotBrushes[1][0] = Brushes.Lime; PlotBrushes[2][0] = Brushes.Transparent; } break; } if (view!=Views.Indicator||indicate==Indicates.RSI) ScaleJustification=ScaleJustification.Left; else ScaleJustification=ScaleJustification.Right;
At the end, the idea is to have the selector (see screen) and plot in color only one of the three indicator. The other two should plot as Transparent (shouldn't be visible). The result I am having are the three plots in colour.
Any further information needed, please ask. Will be really nice if someone could help me with this structure.
Thank you in advance!
Comment