Dear enivid,
yes you have have right with the index. I changed it, like you say, but it does not help. The label is still in the left upper corner.
Dear community,
I would be very grateful if somebody could help me with the position of the label. I would like to create some labels at the end of the indicator lines like on the picture below. The labels should move to right, if we get new candles.
I try to solve the problem with the "price" and "time" property of the CChartObjectLabel object, but the label is always shown at the left upper corner?
Thank you very much!
Hi user_123,
1. Don't create object in OnInit(). There's a risk that the object gets deleted and never will be created again - unless we open the property window.
2. If we create multiple objects, make all of them have different names, for example, My_Lines_1, My_Lines_2, My_Lines_3, ... etc. If we have single name when creating multiple objects, the last created object is the winner, all of previous created objects are all dead.
3. Use CChartObjectText::Create (OBJ_TEXT) and not CChartObjectLabel::Create (OBJ_LABEL). Object text will stick with the chart with price time coordinates while object label will stick with chart window with x, y pixel coordinate - that is why you have one text on left upper corner because you creating text label with x = 0, y = 0 coordinates on upper left = 0 corner with the same name !.
:D
Dear onewithzachy,
thank you very much!
Dear onewithzachy,
thank you very much!
Hi user_123,
You're welcome :)
You may want to anchor it to the left (ENUM_ANCHOR_POINT : ANCHOR_LEFT) and add that time[limit] with (n*PeriodSeconds(PERIOD_CURRENT)). n is the number of bar to the right.
:D
- www.mql5.com

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Dear community,
I would be very grateful if somebody could help me with the position of the label. I would like to create some labels at the end of the indicator lines like on the picture below. The labels should move to right, if we get new candles.
I try to solve the problem with the "price" and "time" property of the CChartObjectLabel object, but the label is always shown at the left upper corner?
Thank you very much!