Expert Advisors • Indicators • Scripts • Libraries

MQL.RobotFX.org is the biggest collection of MetaTrader expert advisors (MT5 & MT4), indicators, scripts and libraries that can be used to improve trading results, minimize risks or simply automate trading tasks

Metatrader 4 Scripts | ModifyOrder | MQL5 Code

Discover expert developed MetaTrader tools that can complement professional solutions.

Image for ModifyOrder

To modify/delete/close a position/pending order you should:



1) Get acquainted with this instruction =)
2) !Specify default values!

(they are below the description, they begin and end with the entry: //+----------------------------------------------+ )


3) Allow the import of external experts

Menu "Tools" -> "Options" -> "Expert Advisors" -> "Allow external experts imports" (it is necessary to describe an error that may occur while placing an order)

Recover from drawdowns intelligently with the Auto Recovery Expert Advisor for MT4/MT5. Perfect for hedging strategies. Learn more.


4) Drag the script to the chart

not far from the order/position that is to be modified.


5) Move all the lines to the necesasry levels:

- Open_Price_Line (white by default) - open price (ONLY FOR THE PENDING ORDERS)


- Stop_Loss_Line (red) - Stop Loss level


- Take_Profit_Line (green) - Take Profit level


- Expiration_Line (yellow) - time of expiration (ONLY FOR THE PENDING ORDERS)


To remove the Stop Loss/Take Profit/Expiration time just delete the corresponding line. To remove the pending order or close the position - delete the Open_Price_Line line.


6) Press the "OK" button when everything is ready.

To stop the script working at any time press the "Cancel" button.


Complement community code with advanced automation from RobotFX.

7748

Best MetaTrader Indicators + Profitable Expert Advisors