MQL4 EA or Script

MQL4 EA or Script


Job Description

Hello all,

I require a simple EA or script to be written that closes all orders (open and pending) when the last open order's TP level is hit.

So if I have multiple trades open at once, and I have multiple limit orders pending as well (all with same currency), and the price action hits the Take Profit (T/P) price for my most recent open order, then the EA or script should close all other open orders and delete all pending orders (with that currency).

Hopefully this is a straightforward EA to build. I'm guessing the logic is in the ability to read all my open orders and know which order is the most recent.

NOTE: It should only close open and limit orders associated with the currency in which the last order's TP level was hit. In other words, I may wish to use this EA for multiple currencies on same account and do not want it to close all orders associated with other currencies.