Text Label to an Indicator Buffer

 

Hello,

how can I set an Text Label in front of an Indicator Buffer. I only know how I can make a fixed position in pixels but I want to fit it on the value of my indicator buffer.

ObjectCreate("Kgu_Label",OBJ_LABEL,windowIndex,0,0);

ObjectSetText("Kgu_Label","Kgu",12,"Tahoma",Lime);

How can I do this?


THANK YOU!

 

S

I think this might do?

https://docs.mql4.com/customind/SetIndexLabel

Good Luck

-BB-

 

Thank you BarrowBoy.

I know this function, but there I can only see the name when I go over with my mouse.

But I would like to see it everytime!

 

OBJ_LABEL is placed with pixel coords
OBJ_TEXT is placed with Time & Price coords.

HTH

 

Thank you, it works!

But as OBJ_TEXT I have no change to see the text everytime on the right side of my chart, even if I scroll the window?!

Is this right?

 

If you want fixed horizontal position (RHS of chart) but variable vertical position (based on price) then ..

A) either use OBJ_LABEL & adjust Y pixel coord based on WindowPriceMax(0) & WindowPriceMin(0)

B) or OBJ_TEXT & adjust X time index position based on WindowBarsPerChart() & WindowFirstVisibleBar(). Actually you might need these for A) as well

C) note that you will not have perfect synch as chart scrolls & zooms, until another tick comes in

D) It IS possible to get better synch via Windows Messages etc, but IMHO it's not worth the effort. YMMV.

 

Hi everybody!

i have a problem with text label...

i want to write an indicator that have a box or panel and the indicator write some information in that.

can you help me please?

 

Hi.

is anybody there?

 
use objects & please next time don't hijack someone else's thread
 

Dear gjol this is my own.

i built that but i want it be better and optimized.

thanks for link but i had seen it before...