How to fix CChartObjectLabel to time and price

 

that way, that even if you scroll the chart, the label remains fixed to time and price.

Thank you 

 
chinaski:

that way, that even if you scroll the chart, the label remains fixed to time and price.

Thank you 

You should use CChartObjectText which anchored to time and price coordinates. 

Documentation on MQL5: Standard Constants, Enumerations and Structures / Objects Constants / Object Properties
Documentation on MQL5: Standard Constants, Enumerations and Structures / Objects Constants / Object Properties
  • www.mql5.com
Standard Constants, Enumerations and Structures / Objects Constants / Object Properties - Documentation on MQL5
 

Hello Phi,

this seems to work. Thank you. My hope was you can also fix rectangles or generally any object to chart.

(For instance draw a rectangle around a specific bar). 

 
chinaski:

Hello Phi,

this seems to work. Thank you. My hope was you can also fix rectangles or generally any object to chart.

(For instance draw a rectangle around a specific bar). 

Probably not planned. In the mean time we can use OnChartEvent and  ChartTimePriceToXY 
 
chinaski:

Hello Phi,

this seems to work. Thank you. My hope was you can also fix rectangles or generally any object to chart.

(For instance draw a rectangle around a specific bar). 

phi.nuts:
Probably not planned. In the mean time we can use OnChartEvent and  ChartTimePriceToXY 
I probably miss something, we can already "draw a rectangle around a specific bar", no ?
 
angevoyageur:
I probably miss something, we can already "draw a rectangle around a specific bar", no ?

Yes, you right :), 

My answer there for pixel based object, like for example this one here (that's poor example actually, because we can draw triangle on time price coordinates).

Rectangle, as chinaski example, is using time price coordinates not pixel coordinates.