How To set text to trandline in mql?

 

Hello all

please help me how to set text (trendline description) to my trendline??

this is my code:


ObjectCreate("myObject", OBJ_TREND, 0, StartDate, price, EndDate, price);

ObjectSet("myObject", OBJPROP_WIDTH, 1);

ObjectSet("myObject", OBJPROP_COLOR, Red);

ObjectSet("myObject", OBJPROP_STYLE, STYLE_DASH);

ObjectSet("myObject", OBJPROP_BACK, true);

ObjectSet("myObject", OBJPROP_RAY, false);



Thank you

 

actually i set text for it like this:

ObjectSetText("myObject", "myObject", 12, "Arial", Red);

and in it's properties it be shown but in chart i have n't any text and when i change the Description it is never Changed or showed...

may oneto help me, please ?

 
  1. Always test your return codes. What is the GetLastError?
  2. Right call, I don't use the last two arguments, works fine.
 

ObjectSetText() right after ObjectCreate() and use WindowRedraw().

If you still don't have 'em, use GetLastError()

 
WHRoeder:
  1. Always test your return codes. What is the GetLastError?
  2. Right call, I don't use the last two arguments, works fine.

thanks dear WHRoeder for reply

i solved that.

actually i understood that what problem is.

when you press F8 and go to common tab, the "show objcet description checkbox" must be checked.

but i have a question now!

how can i active that with my custom indicator?

is it possible?

is there any way to create a template by a custum indicator?


regards

 
onewithzachy:

ObjectSetText() right after ObjectCreate() and use WindowRedraw().

If you still don't have 'em, use GetLastError()


thank you dear onewithzachy for answer.

please look at my new question...


regards

 

Nope, that's WinAPI programming :( . For example like this one https://www.mql5.com/en/forum/131919 - those code is to resize the input prop window, and to do that, the code is long enough.

You have to activate that manually.

 

thanks for helping


Reason: