What I am trying to accomplish seems very simple, but is driving me crazy. I simply want an indicator that plots a line segment that lasts 5 bars just as the attached file.
Specifically in the attached the segment start on the low of the bar, after 4 consecutive lows. This is the code I am using, it gives me no compiling errors, but when I apply this indicator to a chart nothing really happens, can anybody advise what I am doing wrong:
protected override void Initialize()
{
CalculateOnBarClose = false;
Overlay = true;
}
protected override void OnBarUpdate()
{
if (Low[0] <Low[1] && Low[1] <Low[2] &&Low[2] <Low[3])
{
DrawLine("tag1" + CurrentBar, true, 0000, Low[0], 0000, Low[0] + 5, Color.Red, DashStyle.Solid, 2);
}
I tried following NT website instruction on DrawLine() but I am sure I am missing out in the variables(), initiatialize() and/or protect override void() sections.
Comment