Handle cases where the current bar's close is exactly equal to the linear regression

This commit is contained in:
moshferatu 2024-02-07 12:08:49 -08:00
parent 27a94141a2
commit ca7f284332

View File

@ -66,6 +66,12 @@ namespace NinjaTrader.NinjaScript.Indicators
BarBrushes[0] = BelowThresholdColor; BarBrushes[0] = BelowThresholdColor;
CandleOutlineBrushes[0] = BelowThresholdColor; CandleOutlineBrushes[0] = BelowThresholdColor;
} }
else
{
// Handle the rare occasion where the close is equivalent to the linear regression at this bar.
BarBrushes[0] = BarBrushes[1];
CandleOutlineBrushes[0] = CandleOutlineBrushes[1];
}
} }
} }