MQL5: Creating a rectangle anchored in price for Y and chart corner for X

 

As far as my knowledge goes, MT5 has two ways of creating rectangle objects, OBJ_RECTANGLE and OBJ_RECTANGLE_LABEL (plus CCanvas rectangle, but that's another story): one shall be anchored in the chart data, the other must be anchored in the chart dimensions, fixing its position.

What if I want to create a rectangle that anchors horizontally on the chart, but vertically in the price? Is that possible? I don't see any option for that, but I'm a newbie to MQL5.

Thanks!

 
qleaper:

As far as my knowledge goes, MT5 has two ways of creating rectangle objects, OBJ_RECTANGLE and OBJ_RECTANGLE_LABEL (plus CCanvas rectangle, but that's another story): one shall be anchored in the chart data, the other must be anchored in the chart dimensions, fixing its position.

What if I want to create a rectangle that anchors horizontally on the chart, but vertically in the price? Is that possible? I don't see any option for that, but I'm a newbie to MQL5.

Thanks!

Maybe you can play with:

https://www.mql5.com/en/docs/chart_operations/chartxytotimeprice

;)

Documentation on MQL5: Chart Operations / ChartXYToTimePrice
Documentation on MQL5: Chart Operations / ChartXYToTimePrice
  • www.mql5.com
[out]  The time value on the chart, for which the value in pixels along the X axis will be received. The origin is in the upper left corner of the main chart window. [out]  The price value on the chart, for which the value in pixels along the Y axis will be received. The origin is in the upper left corner of the main chart window...
 
Minions Labs:

Maybe you can play with:

https://www.mql5.com/en/docs/chart_operations/chartxytotimeprice

;)

Woa, this might help. Gonna try that, thank you!