Get New position of object While moving it

 

hi friends

I have created an HLine in the chart. I want to get the price of HLine when I move the Hline, and adjust the value obtained as text line.

I've used CHARTEVENT_OBJECT_DRAG for this purpose, but it works when the move is over, but I want a way to get the HLine price position on moving.

 
pooya mahmoodi:

hi friends

I have created an HLine in the chart. I want to get the price of HLine when I move the Hline, and adjust the value obtained as text line.

I've used CHARTEVENT_OBJECT_DRAG for this purpose, but it works when the move is over, but I want a way to get the HLine price position on moving.

of course it works when the move is over, how do you expect it to predict where you are moving it to before you have moved it.

 
Paul Anscombe #:

of course it works when the move is over, how do you expect it to predict where you are moving it to before you have moved it.

Thanks Paul

As you say of course it work when the move is over .

In Common programming languages like C#, there is two type of move event  :"OnMoved" and "OnMoving" . "OnMoved" events is something like "CHARTEVENT_OBJECT_DRAG" . but i want something like "OnMoving" event .

I know that the CHARTEVENT_OBJECT_DRAG is not fit for my purpose, so I want a way to show the price of HLine while mouse button is pressed and object is moving .I want the price to change while the line is moving

 
pooya mahmoodi: but I want a way to get the HLine price position on moving.

So do that. Enable mouse tracking and read the price. See my GUI/Trade Assistant EA (for MT4): 'Money Manager Graphic Tool' indicator by 'takycard' - Risk Management - Articles, Library comments - MQL5 programming forum - Page 6 #55 (2018) and modified for screen resolution #75 (2020.02.17)

 
pooya mahmoodi:

hi friends

I have created an HLine in the chart. I want to get the price of HLine when I move the Hline, and adjust the value obtained as text line.

I've used CHARTEVENT_OBJECT_DRAG for this purpose, but it works when the move is over, but I want a way to get the HLine price position on moving.

There is This DoEasy article series where he does cursor tracking.

https://www.mql5.com/en/articles/9293

CursorTracking
Other classes in DoEasy library (Part 70): Expanding functionality and auto updating the chart object collection
Other classes in DoEasy library (Part 70): Expanding functionality and auto updating the chart object collection
  • www.mql5.com
In this article, I will expand the functionality of chart objects and arrange navigation through charts, creation of screenshots, as well as saving and applying templates to charts. Also, I will implement auto update of the collection of chart objects, their windows and indicators within them.
 
William Roeder #:

So do that. Enable mouse tracking and read the price. See my GUI/Trade Assistant EA (for MT4): 'Money Manager Graphic Tool' indicator by 'takycard' - Risk Management - Articles, Library comments - MQL5 programming forum - Page 6 #55 (2018) and modified for screen resolution #75 (2020.02.17)


thank you ...

 
pennyhunter #:

There is This DoEasy article series where he does cursor tracking.

https://www.mql5.com/en/articles/9293

Perfect , thanks
Reason: