How to set Orange color on trend line  [SOLVED]

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

How to set Orange color on trend line

Postby arjfca » 11 Apr 2017

Hello

I want to draw a trendline with the Orange color

Variable:
Orange (rgb(255,116,21));

Tl_SetColor(TL, Orange);
The trendline color is grey

Any idea

Martin
________________________________________________________________
Using this chart from TJ

1. dark skin= 94, 28, 13,
2. light skin= 241, 149, 108,
3. blue sky= 97, 119, 171,
4. foliage= 90, 103, 39,
5. blue flower= 164, 131, 196,
6. bluish green =140, 253, 153,
7. orange= 255, 116, 21,
8. purplish blue= 7, 47 122,
9. moderate red= 222, 29, 42,
10. purple= 69, 0, 68,
11. yellow green= 187, 255 19,
12. orange yellow= 255, 142, 0,
13. blue= 0, 0, 142,
14. green= 64, 173, 38,
15. red= 203, 0, 0,
16. yellow= 255, 217, 0,
17. magenta= 207, 3, 124,
18. cyan= 0, 148, 189,
19. white (.05)= 255, 255, 255,
20. neutral 8 (.23)= 249, 249, 249,
21. neutral 6.5 (.44)= 180, 180, 180,
22. neutral 5 (.70)= 117, 117, 117,
23. neutral 3.5 (1.05)= 53, 53, 53,
24. black (1.50)= 0, 0, 0,

escamillo
Posts: 203
Joined: 25 Mar 2011
Has thanked: 23 times
Been thanked: 56 times

Re: How to set Orange color on trend line

Postby escamillo » 11 Apr 2017

set the color as a Function, not an Indicator

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

Re: How to set Orange color on trend line

Postby arjfca » 11 Apr 2017

[quote="set the color as a Function, not an Indicator[/quote]

Hello Escamillo

Not yet for me. Same result using a function.

Martin

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

Re: How to set Orange color on trend line

Postby TJ » 11 Apr 2017

Hello

I want to draw a trendline with the Orange color

Variable:
Orange (rgb(255,116,21));

Tl_SetColor(TL, Orange);
The trendline color is grey

Any idea

Martin

Please post your code, including the declaration and drawing of the TL.

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

Re: How to set Orange color on trend line

Postby arjfca » 11 Apr 2017

Hello TJ

The code look for vertical bars that is manually draw on the chart

When found it draw an horizontal lines on the upper and lower price of it.

Code: Select all

while TLNumber > 0 and TLNumber <> tlnumberBack begin
If TL_GetBegin_BN(TlNumber) = TL_GetEnd_BN(Tlnumber) then begin
TlSize = 1;
RectCounter = Rectcounter +1;
RectString = numtostr(tlnumber,0) + comma ;
RectString_2 = numtostr(tlnumber,0) + doublequote ;


TL_BeginDT = TL_GetBegin_DT(TlNumber);
TL_EndingDT = TL_GetEnd_DT(TlNumber);

TL_Val = TL_SetColor(TlNumber,TLColor);
TL_Val = TL_SetSize(Tlnumber, TlSize);


Upper_Line = tl_new_dt(TL_BeginDT, maxlist(TL_GetBeginval(tlnumber),TL_GetEndVal(tlnumber)), TL_BeginDT, maxlist(TL_GetBeginval(tlnumber),TL_GetEndVal(tlnumber)));
RectString = RectString + numtoStr(Upper_Line,0) + comma;
RectString_2 = RectString_2 + numtoStr(Upper_Line,0) + doublequote;

Tlcolor = orange;
tl_setextright(Upper_line, true);
TL_SetSize(Upper_Line, TlSize);
TL_SetColor(Upper_line,TlColor);

lower_Line = tl_new_dt(TL_BeginDT, minlist(TL_GetBeginval(tlnumber),TL_GetEndVal(tlnumber)), TL_BeginDT, minlist(TL_GetBeginval(tlnumber),TL_GetEndVal(tlnumber)));
RectString = RectString + numtoStr(Lower_Line,0);
RectString_2 = RectString_2 + numtoStr(Lower_Line,0);

tl_setextright(lower_line, true);
TL_SetSize(lower_Line, TlSize);
TL_SetColor(lower_line,TlColor);


RectanglesString [Regioncounter] = Rectstring;
Rectcounter = rectcounter +1;



print ("RecString_Complet: ", RecString_Complete, "commacount: ", countcomma( RecString_Complete));

end;

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

Re: How to set Orange color on trend line

Postby TJ » 11 Apr 2017

Code: Select all


Tl_SetColor( TLNumber , Orange);

escamillo
Posts: 203
Joined: 25 Mar 2011
Has thanked: 23 times
Been thanked: 56 times

Re: How to set Orange color on trend line

Postby escamillo » 11 Apr 2017

try this a a function (Function named Orange) and see if it works

Code: Select all

Orange = 42495 ;

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

Resolve: How to set Orange color on trend line  [SOLVED]

Postby arjfca » 11 Apr 2017

I found the problem

In my code I was using

Code: Select all

[LegacyColorValue =true];
Once removed the proper color is displayed

Thanks to all

Martin


Return to “MultiCharts”