I've created an indicator that prints a line on the chart when certain conditions are met. The input for the line is Low[0]. For some reason, at certain times the line is being printed at the High[0]. Can someone please take a look at my code. I believe the issue is with the other indicator that I've created to use as a condition, but I can't figure out why that would change the input from Low to High.
Thanks.
#region Variables private int triggerBar1 = -1; private int entryKillBar1 = -1; private double plotValue1 = 0; #endregion
protected override void Initialize() { Add(new Plot(Color.FromKnownColor(KnownColor.Red), PlotStyle.Line, "Low")); Overlay = true; }
if(CurrentBar < 2) return; double line_Prev = WilliamsR(RMI(BOP (Close,10),14,3),8)[1]; double line_Current = WilliamsR(RMI(BOP (Close,10),14,3),8)[0]; if(line_Prev == 0 && line_Current < 0) { this.triggerBar1 = CurrentBar; this.entryKillBar1 = CurrentBar + 25; this.plotValue1 = Low[0]; } if (CurrentBar == this.entryKillBar1 + 1) { this.triggerBar1 = -1; this.entryKillBar1 = -1; } if (CurrentBar > this.triggerBar1 && CurrentBar <= this.entryKillBar1) { Low.Set(this.plotValue1); Print(Time[0]); Print(Low[0]); } else { Low.Reset(); }
Comment