protected override void Initialize() { Add(new Plot(Color.FromKnownColor(KnownColor.Transparent), PlotStyle.Line, "K")); Add(new Plot(Color.FromKnownColor(KnownColor.Plum), PlotStyle.Hash, "D")); Add(new Line(Color.FromKnownColor(KnownColor.Maroon), 75, "Above")); Add(new Line(Color.FromKnownColor(KnownColor.Black), 50, "Middle")); Add(new Line(Color.FromKnownColor(KnownColor.Maroon), 25, "Below")); } protected override void OnBarUpdate() { K.Set(stoch.K[0]); D.Set(stoch.D[0]); } #region Properties [Browsable(false)] [XmlIgnore()] public DataSeries K { get { return Values[0]; } } [Browsable(false)] [XmlIgnore()] public DataSeries D { get { return Values[1]; } }
protected override void Initialize() { Add(new Plot(Color.FromKnownColor(KnownColor.Black), PlotStyle.Line, "K_Above75")); Add(new Plot(Color.FromKnownColor(KnownColor.DarkViolet), PlotStyle.Line, "K_Middle")); Add(new Plot(Color.FromKnownColor(KnownColor.Black), PlotStyle.Line, "K_Below25")); Add(new Plot(Color.FromKnownColor(KnownColor.Transparent), PlotStyle.Line, "K")); Add(new Plot(Color.FromKnownColor(KnownColor.Plum), PlotStyle.Hash, "D")); Add(new Line(Color.FromKnownColor(KnownColor.Maroon), 75, "Above")); Add(new Line(Color.FromKnownColor(KnownColor.Black), 50, "Middle")); Add(new Line(Color.FromKnownColor(KnownColor.Maroon), 25, "Below")); Plots[0].Min = 75; Plots[1].Max = 75; Plots[1].Min = 25; Plots[2].Max = 25; } protected override void OnBarUpdate() { if(CurrentBar < 20) return; K_Above75.Set(stoch.K[0]); K_Middle.Set(stoch.K[0]); K_Below25.Set(stoch.K[0]); K.Set(stoch.K[0]); D.Set(stoch.D[0]); } #region Properties [Browsable(false)] [XmlIgnore()] public DataSeries K_Above75 { get { return Values[0]; } } [Browsable(false)] [XmlIgnore()] public DataSeries K_Middle { get { return Values[1]; } } [Browsable(false)] [XmlIgnore()] public DataSeries K_Below25 { get { return Values[2]; } } [Browsable(false)] [XmlIgnore()] public DataSeries K { get { return Values[3]; } } [Browsable(false)] [XmlIgnore()] public DataSeries D { get { return Values[4]; } }
I removed the indicator from the chart and added it again. This time the Plots window showed Plots D and K which was all the indicator had before.
After scrutinizing the code for 30 mins and not finding anything wrong I decided to just rewrite the indicator. I did with copied/pasted data from the first indicator. I simply relabeled it. This indicator worked just fine.
I then attempted to delete the first indicator. I got an error message that it couldn't delete because of the .cs. I thought this was strange as I've deleted indicators before without issue. So I went into my Documents\NinjaTrader7\bin\Custom\Indicator and deleted that file.
So now the indicator is deleted right? Wrong! I could still add the indicator to a chart! It wasn't listed in the ControlCenter\Tools\EditNinjaScript window, but I could pull it up on a chart.
Two other indicators I created are dependent on this indicator so I thought maybe I needed to comment out the references to the first indicator. I did that and FINALLY the first indicator was no longer available to be added to a chart. Great.
So now I had a copy of the first indicator. Since I have 2 indicators that are dependent on the first I decided to do a Save As on the second indicator and rename it as the first. Before this point the first indicator was no longer on my machine and the references in the other indicators we commented out and recompiled. Then I saved the second indicator with the name of the first. The Saved As indicator file was back at Documents\NinjaTrader7\bin\Custom\Indicator as expected and was in the ControlCenter\Tools\EditNinjaScript window, but was not available to add to a chart! When I uncommented the references in the other indicators and recompiled suddenly the Saved As indicator was available to add to a chart. But it was added with only two plots D and K!
That indicator, as far as I know is no longer on my machine! How is it still being added to my chart? It's Undead! Please help.
Comment