I want a little indicator that if sloping up it plots blue color, if sloping down it plots red and if values are the same its white.
I think i am doing something wrong with round. It can stay and show 0 for some time because it rounds it and values are fluctuating between 0.01 - 1. How to make it right?
And also if it displays 0 it would be displayed in border white
I want to display slope difference in ticks between 2 emas
protected override void OnBarUpdate()
{
fastValue = EMA(Close,FastEMA)[0];
slowValue = EMA(Close,SlowEMA)[0];
SEMA[0] = fastValue;
FEMA[0] = slowValue;
diff = Math.Abs(fastValue - slowValue);
ang = Math.Round(diff);
//Print(diff);
//NinjaTrader.Gui.Tools.SimpleFont myFont = new NinjaTrader.Gui.Tools.SimpleFont("Courier New", 26) { Size = 50, Bold = true };
if (slowValue == fastValue)
Draw.TextFixed(this, "angulation", "this" + ang.ToString(), TextPosition.TopRight, ChartControl.Properties.ChartText, myFont, Brushes.White, Brushes.Transparent, 0);
else if (fastValue > slowValue)
Draw.TextFixed(this, "angulation", "" + ang.ToString(), TextPosition.TopRight, ChartControl.Properties.ChartText, myFont, Brushes.Blue, Brushes.Transparent, 0);
else
Draw.TextFixed(this, "angulation", "" + ang.ToString(), TextPosition.TopRight, ChartControl.Properties.ChartText, myFont, Brushes.OrangeRed, Brushes.Transparent, 0);
}

Comment