PDA

View Full Version : Multicolor Indicator that is Not an Oscillator


MJT
05-16-2007, 05:13 AM
Other posts here explain how to plot an indicator with changing color using a threshold ( Plots[0].Min / Plots.[1].Max ). I want to color my indicator depending on whether it is above or below current price, and resetting the threshold to current price means the color change point moves for historical bars.

Using a simple-

if (myIndicator > Close[0])
MyIndicatorAbove.Set(myIndicator);
else
MyIndicatorBelow.Set(myIndicator);

will work using Plot Style of Dot, but if I use Line then I get a gap at each color change.

I think I need to force the new color plot to start from the end of the previous bar, rather than the current bar onwards. I also think I have seen a solution here before, but can't find it now (maybe that was a dream!!).

Is there a simple solution to this, so that I can use a Line rather than a Dot to plot my indicator?

NinjaTrader_Ray
05-16-2007, 07:09 AM
See the following thread, post #2.

http://www.ninjatrader-support.com/vb/showthread.php?t=1675&highlight=whitmark

MJT
05-16-2007, 10:34 AM
Thank you Ray, that is exactly what I was looking for.

saltminer
01-14-2009, 08:17 PM
This creates 3 entries in the databox, one for each color. At any one time, two of the fields are empty and one contains the data value.
What would be desirable is a way to display just one thing in the databox, that always has the correct data.
Is there a way to program this please? I suspect there is because I have seen it in other people's indicators. (Proprietary and unbrowsable, so I can't just go inside and look how they did it.)
Thanks,
saltminer

NinjaTrader_Josh
01-15-2009, 07:10 AM
saltminer,

Unfortunately other approaches are currently not supported.