I have a custom NinjaTrader 8 indicator that uses a color spectrum to color a plot according to specific levels on the indicator panel. The levels and corresponding RGB colors are as follows:
- 0 - 20: (0, 255, 255)
- 20 - 50: (0, 255, 0)
- 50 - 80: (255, 255, 0)
- 80 - 100: (255, 0, 0)
I prefer using RGB values instead of the built-in NinjaTrader colors, and I mention this in case using RGB values might cause issues.
After some time, the color spectrum seems to get stuck on one specific color. To fix this, I need to remove and re-add the indicator to the chart to update the colors.
In the past, I've noticed that setting the indicator to "OnBarClose" instead of "OnEachTick" can sometimes fix this issue, but not always.
However, I would prefer to keep the indicator set to "OnEachTick" while ensuring the colors do not get stuck.
I'm seeking advice on how to fix this problem or a reference script that addresses this issue.
Any help would be much appreciated.
Thank you.

Comment