This EA can be used alongside other EAs to manage order closures, with specific functions detailed in the "Terminology" section below. For example, in MT4, open two EURUSD charts: load an EA for placing orders on one chart and this EA on the other. When the order-placing EA generates an order that reaches the profit target, this EA adjusts the stop loss to lock in profits.
The "Order Magic Number" parameter of this EA defaults to 0, meaning it operates on all orders for the symbol. If a number greater than 0 is entered, the EA will only manage orders placed by an EA with the same "Order Magic Number."
Order Magic Number: When multiple order-placing EAs are loaded for the same symbol, each EA must have a unique number in its "Order Magic Number" parameter to distinguish its orders. This prevents logical errors by allowing EAs to identify and manage their respective orders.
Points: 1 point corresponds to the last decimal place of the symbol's price. For a 5-decimal price, 1 point is 0.00001; for a 4-decimal price, 1 point is 0.0001.
Break-Even:
One-Time Break-Even: If enabled, this instruction applies the break-even stop loss adjustment to an order only once. If this option is enabled, this instruction should be placed before the order-placing module to clear stored order status information when no orders are open.
Partial Closure: In MT4, if an order is partially closed, the remaining portion is treated as a new order by this EA.