Strategy: This EA activates when the number of same-direction orders for the current symbol is at least 2. It can be used alongside other EAs, with details provided in the "Terminology" section below. For example, in MT4, open two EURUSD charts: load an EA for placing orders and counter-trend add-ons on one chart, and this EA on the other. When the order-placing EA opens an initial order, this EA sets the take profit price. If the initial order incurs a loss and the order-placing EA adds a counter-trend order, this EA calculates the average entry price of the two orders and uniformly adjusts the take profit price for each order.
The "Order Magic Number" parameter defaults to 0, meaning it operates on all orders for the symbol. If a number greater than 0 is entered, the EA only manages orders placed by an EA with the same "Order Magic Number." This EA can also work with manual trading: users place and add orders based on their judgment, and the EA automatically calculates the average entry price of open orders, then uniformly adjusts the take profit price, reducing the user’s workload.
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.
Same-Direction Average Take Profit Points: