morgb Posted April 18, 2011 Report Posted April 18, 2011 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 :-) Quote
morgb Posted April 18, 2011 Author Report Posted April 18, 2011 wooohoo I found out :-) ObjectSetText("text_object", "Hello world!", 10, "Times New Roman", Green); Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.