In the NT7 version, once the line color was changed, it would stay that color until a new change occurred, even if the there was no slope. That is, the default color did not come back. I don't understand the reason NT8 does not work this way.
But in any case, I could fix the issue by adding another condition for the slope where if it is neither up nor down, then use the previous color. To do so I would need to use another variable that records the current color and then applies it when necessary. How would I do this?
Here is the code I have now in the color section.
slowSlope = Values[2]; // this is the line we are looking to change color
if ( ColorMA == true && InvertColor == false ) // colors not inverted
{
if ( IsRising(slowSlope) )
{
PlotBrushes[2][0] = Brushes.Green; // slow ma in uptrend
}
else if ( IsFalling(slowSlope) )
{
PlotBrushes[2][0] = Brushes.Red; // slow ma in downtrend
}
}

Comment