trendline of hi + lo

Questions about MultiCharts and user contributed studies.
fibonaccci
Posts: 49
Joined: 26 Dec 2009
Has thanked: 34 times
Been thanked: 1 time

trendline of hi + lo

Postby fibonaccci » 16 Dec 2011

Hi,
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);

User avatar
TJ
Posts: 7742
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2222 times

Re: trendline of hi + lo

Postby TJ » 16 Dec 2011

Hi,
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);
what do you mean by "Does anyone know why it does not work properly?"
You have to describe what do you observe that you think is not working properly.
e.g won't compile? error messages? crashed the computer? nothing on the screen? too many lines on the screen? wrong lines at the wrong place? wrong color?

you should post some screen shots with notes describing what you are expecting, and what is wrong on the chart.

you should also make comments on the code about what you have changed, and why you have changed, so that people don't have to read through the whole thing to decipher what you have changed.


Return to “MultiCharts”