can anyone help please with my indicator
which supposes to draw a horizontal line in the future from the low and the high of each bar
that meets a certain condition e.g. crossover of 2 lines.
Does anyone know why it does not work properly?
Thank you very much for your help/suggestions
below is my changed code by TJ
( viewtopic.php?f=5&t=9460&p=45234&hilit=plot+line#p45234 )
Code: Select all
inputs: Price( Close ), FastLength( 20 ), SlowLength( 50 ) ;
variables: var0( 0 ), var1( 0 ) ;
var0 = AverageFC( Price, FastLength ) ;
var1 = AverageFC( Price, SlowLength ) ;
var:
tl.h(-1),
tl.l(-1);
{once}
condition1 = {CurrentBar > 1 and} var0 crosses over var1 {and BarType =1 }{<3};
if condition1 then
begin
tl.h = tl_new(d, t, 0, d, t, 0);
tl_setextright(tl.h, true); {tl_setextleft(tl.h, true);} // <-- comment this out if you want forward only
tl.l = tl_new(d, t, 0, d, t, 0);
tl_setextright(tl.l, true); {tl_setextleft(tl.l, true);} // <-- comment this out if you want forward only
end;
tl_setend(tl.h, d, t, high);
tl_setbegin(tl.h, d[1], t[1], high);
tl_setend(tl.l, d, t, low);
tl_setbegin(tl.l, d[1], t[1], low);