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.
Maybe you can play with: