I am pretty new to Ninja and am trying some simple stuff to get over the learning curve, here is a piece of code I wrote to draw a horizontal line when the slope marked ' 0 slope'
if (Slope(EMA(20), 5, 0) > -0.01 && Slope(EMA(20), 5, 0) < 0.01 )
{
DrawText("MyText" + CurrentBar, "0 Slope", 0, GetCurrentAsk() + 5 * TickSize, Color.Red);
DrawHorizontalLine("my", Close[0], Color.Blue);
flatSlope = true;
}else
{
flatSlope = false;
}
Here is the backtest result; I can see 'drawText' is working with ' 0 slope', but where is my horizontal line?
This is the NT7 documentation:
Syntax
DrawHorizontalLine(string tag, double y, Color color)
Examples
// Draws a horizontal line DrawHorizontalLine("tag1", 1000, Color.Black); |
Thanks!
Comment