Page 1 of 1

Found the Origin of a trendline:

Posted: May 04 2017
by arjfca
I need my code to affect some trendline created by an indicator, but not the trendline created by another one.

How can I get the Origin of a trend line? I know that I could use the TL_Getfirst(Origin) and loop but is there a way to find it directly?


Martin

Re: Found the Origin of a trendline:

Posted: May 04 2017
by TJ
I need my code to affect some trendline created by an indicator, but not the trendline created by another one.

How can I get the Origin of a trend line? I know that I could use the TL_Getfirst(Origin) and loop but is there a way to find it directly?


Martin

You need to make an illustration.

Re: Found the Origin of a trendline:

Posted: May 04 2017
by arjfca
Modifying the style of a trendline is affecting the style of the default trendline style.

The goal is to toggle the style of a trendline created by a given indicator from a solid line to a dot line .

Doing so, it is affecting the default style when I manually draw a trendline.

AffectedTL.png
(74.48 KiB) Downloaded 486 times

Re: Found the Origin of a trendline:  [SOLVED]

Posted: May 04 2017
by TJ
Thanks for the illustration...


but I am getting a headache.

:roll: :oops:


:lol:

Re: Found the Origin of a trendline:

Posted: May 04 2017
by arjfca
I think I resolve the problem

I was doing a validation with a function. Testing if the next draw trendilne number was the same of TL_GetNext(TlNumber -1, 1)

I put the code in my Main indicator and the problem seem to be resolve.

Code: Select all

Input:
TL_Num (NumericSimple);

Var:
TL_Prev (Tl_Num-1),
TL_Next (0);

ValidTrendline = False;

TL_Next = TL_GetNext(TL_Prev,1);
If TL_Next = TL_Num then ValidTrendline = True else ValidTrendline = False;