Thank you for the post.
This looks to be caused becasue the indicator is being set in Initialize. This should be set from OnBarUpdate in bar 0 instead:
private Stochastics stochK; protected override void Initialize() { Add(new Plot(Color.Blue, "StochK0"));// [0] Add(new Plot(Color.Blue, "StochK1"));// [1] Add(new Plot(Color.Blue, "Stoch42"));// [2] Add(new Plot(Color.Blue, "StochK")); // [3] CalculateOnBarClose = true; } protected override void OnBarUpdate() { if(CurrentBar == 0) stochK = Stochastics(7,3,14); StochK[0] = stochK.K[0]; } [Browsable(false)] [XmlIgnore()] public DataSeries StochK { get { return Values[3]; } }
Comment