Found the Origin of a trendline:  [SOLVED]

Questions about MultiCharts and user contributed studies.
arjfca
Posts: 1292
Joined: 23 Nov 2010
Has thanked: 725 times
Been thanked: 223 times

Found the Origin of a trendline:

Postby arjfca » 04 May 2017

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

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

Re: Found the Origin of a trendline:

Postby TJ » 04 May 2017

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.

arjfca
Posts: 1292
Joined: 23 Nov 2010
Has thanked: 725 times
Been thanked: 223 times

Re: Found the Origin of a trendline:

Postby arjfca » 04 May 2017

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

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

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

Postby TJ » 04 May 2017

Thanks for the illustration...


but I am getting a headache.

:roll: :oops:


:lol:

arjfca
Posts: 1292
Joined: 23 Nov 2010
Has thanked: 725 times
Been thanked: 223 times

Re: Found the Origin of a trendline:

Postby arjfca » 04 May 2017

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;


Return to “MultiCharts”