X Values like OBJ_RECTANGLE_LABEL, Y Values like OBJ_RECTANGLE?

 

I would like to create a rectangle for which:

Y: the height behaves like with OBJ_RECTANGLE, ie height adjusts when the y-axis is zoomed in or out by the user, as the rectangle's y coordinates are defined by price1 and price2.

X: the width behaves like with OBJ_RECTANGLE_LABEL, ie where the x values are NOT fixed by time, not connected to the x-axis.


Does anyone know of a way to do this, for a script rather than an indicator, without getting into OnChartEvents and redrawing please?

Essentially i am looking for something like an  OBJ_RECTANGLE_LABEL_XONLY  that allows price1 and price 2 to be used for the y coordinates.

Many thanks for any suggestions.

 

Perhaps you should read the manual. Get your Y ChartXYToTimePrice
   How To Ask Questions The Smart Way. 2004
      How To Interpret Answers.
          RTFM and STFW: How To Tell You've Seriously Screwed Up.

You haven't stated a problem, you stated a want. Show us your attempt (using the CODE button) and state the nature of your problem.
          No free help 2017.04.21

Or pay someone. Top of every page is the link Freelance.
          Hiring to write script - General - MQL5 programming forum 2018.05.12

 

Thanks William. I did a lot of RTM and STW before coming to a forum as a last resort, exactly because i hate to waste anyone's time. Sorry to have done things wrong. I tried to be concise.

I am not asking for code. I just want to check that i'm not reinventing something which already exists but whose name or other UID i was unable to STW for. 

In terms of the problem, in case anyone's interested, this is for a VAP Profile tool which i have working well for me as the only user and with the functionality i found missing in similar tools for my specific idiosyncracies. Some missing functionality is to be able to anchor a profile to the left side of the window, regardless of TF or zoom, but remain relevant in terms of price when the y-axis is either stretched or squeezed.

To be able to create a rectangle object which sets Y like OBJ_RECTANGLE, but X like OBJ_RECTANGLE_LABEL, would be ideal, so before i decide whether to go around the problem or attempt to code it as an indicator with OnEvent() or OnTimer() checks (possibly using either ChartXYToTimePrice or vice versa), it would be prudent to just check something similar does not already exist within MQL or the many libraries that generous people have contributed to our community.

If anyone has come across such a library or funciton within the community then it would be a great help, and perhaps interesting to other people too. 

 
MacDougall #:

Thanks William. I did a lot of RTM and STW before coming to a forum as a last resort, exactly because i hate to waste anyone's time. Sorry to have done things wrong. I tried to be concise.

I am not asking for code. I just want to check that i'm not reinventing something which already exists but whose name or other UID i was unable to STW for. 

In terms of the problem, in case anyone's interested, this is for a VAP Profile tool which i have working well for me as the only user and with the functionality i found missing in similar tools for my specific idiosyncracies. Some missing functionality is to be able to anchor a profile to the left side of the window, regardless of TF or zoom, but remain relevant in terms of price when the y-axis is either stretched or squeezed.

To be able to create a rectangle object which sets Y like OBJ_RECTANGLE, but X like OBJ_RECTANGLE_LABEL, would be ideal, so before i decide whether to go around the problem or attempt to code it as an indicator with OnEvent() or OnTimer() checks (possibly using either ChartXYToTimePrice or vice versa), it would be prudent to just check something similar does not already exist within MQL or the many libraries that generous people have contributed to our community.

If anyone has come across such a library or funciton within the community then it would be a great help, and perhaps interesting to other people too. 

Hi @MacDougall

Did you find the answer to your issues? I am facing the same issue now, and would be glad if you can share the solution, if discovered by you.

Thanks