Download MetaTrader 5

Replicating MT4 function in my EA

To add comments, please log in or register
Add our Facebook page to friends. Follow the latest news!
Ernest Klokow
1084
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
30737
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