trailing stop

 

If you are using multiple pairs, 1 EA, 1 magic number.

Then if you optimized for trailing stop then I'm assuming the EA won't have a problem managing each pair with the same number because it will look up the orders by the pair right ? but what if you optimize the EA every day with a different trailing stop then will the EA still be able to differentiate the different pairs but it will apply the new trailing stop to any old open orders and then perhaps create conflicts where the old orders are using new trailing stops that don't necessarily fit with the other parameters?   Then to avoid this is there an existing EA or script or would you just have to open up a new chart of the same symbol and attach the new .set and then disable trading on the old chart while still allowing the EA to manage open orders (and how would you do that)?

 
dustovshio: I'm assuming the EA won't have a problem managing each pair with the same number because it will look up the orders by the pair right ?

Depends on how it/they is/are coded; ask the owner, or provide the code.

Magic number only allows an EA to identify its trades from all others. Using OrdersTotal/OrdersHistoryTotal (MT4) or PositionsTotal (MT5), directly and/or no Magic number/symbol filtering on your OrderSelect / Position select loop means your code is incompatible with every EA (including itself on other charts and manual trading.)
          Symbol Doesn't equal Ordersymbol when another currency is added to another seperate chart . - MQL4 programming forum (2013)
          PositionClose is not working - MQL5 programming forum (2020)
          MagicNumber: "Magic" Identifier of the Order - MQL4 Articles (2006)
          Orders, Positions and Deals in MetaTrader 5 - MQL5 Articles (2011)
          Limit one open buy/sell position at a time - General - MQL5 programming forum (2022)

You need one Magic Number for each symbol/timeframe/strategy. Trade current timeframe, one strategy, and filter by symbol requires one MN.

Reason: