Jump to content

Adding Description to Trendline Automatically


morgb

Recommended Posts

Can anyone please help me to add a description automatically to a trend-line in a piece of code ? The following code draws trend line's on your chart :-

 

ObjectCreate("TL1", OBJ_TREND, 0, T2, PP + Step*AB, T1, PP);

ObjectSet("TL1", OBJPROP_COLOR, Silver);

ObjectSet("TL1", OBJPROP_WIDTH, 1);

ObjectSet("TL1", OBJPROP_STYLE, STYLE_SOLID);

ObjectCreate("TL2", OBJ_TREND, 0, T2, P2, T1, P1);

ObjectSet("TL2", OBJPROP_COLOR, Silver); a

ObjectSet("TL2", OBJPROP_WIDTH, 1);

ObjectSet("TL2", OBJPROP_STYLE, STYLE_SOLID);

ObjectCreate("MIDL", OBJ_TREND, 0, T2, (P2 + PP + Step*AB) / 2, T1, (P1 + PP) / 2);

ObjectSet("MIDL", OBJPROP_COLOR, Silver);

ObjectSet("MIDL", OBJPROP_WIDTH, 1);

ObjectSet("MIDL", OBJPROP_STYLE, STYLE_DOT);

Comment(" Channel size = ", DoubleToStr(MathAbs(PP - P1) / Point, 0), " Slope = ",

DoubleToStr(-Step / Point, 2));

 

If you click on the properties of the trend line on the chart it displays T1 + T2, I need to modify the code to add some pre defined text into the description properties of the trend line, so every time it re-draws the description is still there ?

 

Thanks in advance :-)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...