Welcome Forex EA downloads & MT4/MT5 auto-trading resources — EAs, Gold EAs, quant tools and real-world automation.
Sign In Sign Up

Partial Closing Sell Order - MetaTrader 5 Script | Trading Script Download - MT4/MT5 Resources

author EAcpu | 4 reads | 0 comments |

Partial close Sell Orders - script for MetaTrader 5

The main purpose of this script is to close some of the open sell orders (i.e. profit) and let other running orders close with the target profit. Check the information in the Expert tab after execution.

Partial close Sell Orders - script for MetaTrader 5

Input parameters :

ClosePercentage : Percentage (0-100) of each sell position that you want to close

Slippage: Maximum slippage allowed (in points)

CommentText: if you only want to close positions with a specific comment (leave it empty for all sell positions)

Works with multiple sell positions

Keep stop loss and take profit levels for remaining positions

Verify minimum volume requirements

Handle errors and provide feedback

Copy the code to MetaEditor

Compile (F7)

The script will appear in the Navigator panel under "Scripts"

Drag it to any chart to execute

The script will close a specified percentage of all sell positions unless you filter by comments

It uses FOK (Fill or Kill) execution type to ensure that the entire partial closing position is filled at once

Remaining positions will maintain their original Stop Loss/Take Profit levels


Attachment download

📎 partial_close_sell_orders.mq5 (3.99 KB)

Source: MQL5 #60233

Verification code Refresh