Download MetaTrader 5
To add comments, please log in or register
Do you want to know about the MQL5.community development? Have a look at the Wall!
Ernest Klokow
1069
Ernest Klokow 2014.10.09 08:19 

I am writing an EA where I draw a horizontal line at a specific price level. This is similar to placing a S/L or T/P in MT4 where a line is drawn at the specific level or dragged from the transaction line to the specific price level. In MT4 you can also drag the existing line to a new position and the value of the S/L or T/P is automatically updated.

How can we do this dragging of the line with automated update of the new position in MQL4? I have searched and searched and cannot find any code examples of this function.

Can anybody perhaps help?

Alain Verleyen
Moderator
28536
Alain Verleyen 2014.10.09 09:57  
ernest02:

I am writing an EA where I draw a horizontal line at a specific price level. This is similar to placing a S/L or T/P in MT4 where a line is drawn at the specific level or dragged from the transaction line to the specific price level. In MT4 you can also drag the existing line to a new position and the value of the S/L or T/P is automatically updated.

How can we do this dragging of the line with automated update of the new position in MQL4? I have searched and searched and cannot find any code examples of this function.

Can anybody perhaps help?

You have to use OnChartEvent handler with CHARTEVENT_OBJECT_DRAG event.
/
To add comments, please log in or register