Hi!

I am trying to display trendlines, that join the two last fractals.
I created a static var, that joins the last fractals, but it does not join the points diagonally, but takes the last non-zero fractal value. Any idea?

Here's the code:

function run()
{
set(PLOTNOW);
StartDate = EndDate = 2010;

var FH = FractalHigh(series(price()),5);

if (FH>0 or FH<0) plot("FH", FH, DOT, GREEN);

static var TrendLine; if(FH>0 or FH<0) {TrendLine = FH;}
plot("TrendLine", TrendLine, LINE, PURPLE);
}