My custom indicator, dpSlope, has two public boolean properties; "isRising" and "isFalling":
[Browsable(false)] [XmlIgnore] public bool isRising { get { return SlopeRising; } } [Browsable(false)] [XmlIgnore] public bool isFalling { get { return SlopeFalling; } }
#region Variables private bool SlopeRising = false; private bool SlopeFalling = false; #endregion
if (IsRising(Values[0])) { PlotBrushes[0][0] = Brushes.Green; SlopeFalling = false; SlopeRising = true; } else if (IsFalling(Values[0])) { PlotBrushes[0][0] = Brushes.Red; SlopeFalling = true; SlopeRising = false; }
In the Strategy, I added the indicator so that it plots it in the chart.
else if (State == State.Configure) { AddChartIndicator(dpSlope(SlopePeriod, SlopeLookBack, false)); AddChartIndicator(MACD(12, 26, 9)); }
In the strategy OnBarUpdate method, I use the following code to access the bool properties:
Print("isRising " + dpSlope(SlopePeriod, SlopeLookBack, false).isRising); if ((dpSlope(SlopePeriod, SlopeLookBack, false).isRising) && (CrossAbove(MACD(12,29,9).Diff,0,1)))
If I use Visual Studio to set breakpoints at the point these variables are updated in the indicator, they will never be hit.
I am at a loss as to why this may be happening. Any help would be appreciated.
Regards,
dp2002
Comment