if i place the following ea on two different charts ie usdjpy an gbpjpy will it assign different magic numbers or will the ea in one chart be able to affect ie close trade on the other chart:


//+------------------------------------------------------------------+
//|                                               BreakoutScalper.mq5|
//|                        Scalper EA - trades quick price breakouts|
//+------------------------------------------------------------------+
#property copyright "Ch"
#property link      ""
#property version   "1.07"
#property strict

input double  Lots                  = 0.01;                 // Lot size
input int     PointsThreshold       = 70;                  // Move in points to trigger trade
input int     CheckInterval         = 10;                   // Seconds to check price movement(10,5))
input int     TrailingStopPoints    = 60;                  // Trailing stop in points
input int     EAStartHour           = 3;                   // EA start hour (server time)
input int     EAStopHour            = 20;                  // EA stop hour (server time)
input ENUM_TIMEFRAMES PriceTF       = PERIOD_M1;           // Timeframe for reference (for convenience)
input int     TradesPerSignal       = 1;                   // Number of orders to open per breakout signal
input int     InitialStopLossPoints = 75;                  // Initial stop loss in points at trade open

//--- Global variables
datetime lastCheckTime = 0;
double   priceAtLastCheck = 0.0;

string priceMoveLineName       = "PriceMoveLine";
string priceMoveTextName       = "PriceMoveText";      // current move stats label

string maxPosMoveTextName      = "MaxPosMoveText";     // max positive move label
string maxNegMoveTextName      = "MaxNegMoveText";     // max negative move label

string breakoutArrowNameBuy    = "BreakoutBuy";
string breakoutArrowNameSell   = "BreakoutSell";

// Tracking max positive and negative moves (points and rates)
double maxPosPointsMoved      = 0.0;
double maxPosRatePointsPerSec = 0.0;

double maxNegPointsMoved      = 0.0;  // store positive number of max negative move absolute
double maxNegRatePointsPerSec = 0.0;

//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
  {
   lastCheckTime = TimeCurrent();
   priceAtLastCheck = SymbolInfoDouble(_Symbol, SYMBOL_BID);
   return(INIT_SUCCEEDED);
  }

//+------------------------------------------------------------------+
//| Expert deinitialization function                                 |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
  {
   CleanOldObjects();
  }

//+------------------------------------------------------------------+
//| Check if current time is inside operation window                 |
//+------------------------------------------------------------------+
bool IsWithinTradingTime()
  {
   datetime now = TimeCurrent();
   MqlDateTime tm;
   TimeToStruct(now, tm);

   if(tm.hour >= EAStartHour && tm.hour < EAStopHour)
     return true;
   else
     return false;
  }

//+------------------------------------------------------------------+
//| Check if EA has any open positions on current symbol             |
//+------------------------------------------------------------------+
bool HasOpenPositions()
  {
   for(int i=0; i<PositionsTotal(); i++)
     {
      ulong ticket = PositionGetTicket(i);
      if(PositionSelectByTicket(ticket))
        {
         if(PositionGetInteger(POSITION_MAGIC) == ExpertHandle() &&
            PositionGetString(POSITION_SYMBOL) == _Symbol)
           return true; // EA has open position(s) on symbol
        }
     }
   return false; // no open position found for EA
  }

//+------------------------------------------------------------------+
//| Place buy order with initial stop loss                           |
//+------------------------------------------------------------------+
bool PlaceBuy()
  {
   MqlTradeRequest request;
   MqlTradeResult  result;
   ZeroMemory(request);
   ZeroMemory(result);

   double price = SymbolInfoDouble(_Symbol, SYMBOL_ASK);
   double sl_price = NormalizeDouble(price - InitialStopLossPoints*_Point, _Digits);

   if(sl_price <= 0.0)
     {
      Print("Invalid SL price calculated for buy.");
      return false;
     }

   request.action = TRADE_ACTION_DEAL;
   request.symbol = _Symbol;
   request.volume = Lots;
   request.type   = ORDER_TYPE_BUY;
   request.price  = price;
   request.sl     = sl_price;
   request.tp     = 0;
   request.deviation = 10;
   request.magic = ExpertHandle();

   if(!OrderSend(request, result))
     {
      PrintFormat("Buy order failed: %s", result.comment);
      return false;
     }
   else
     {
      PrintFormat("Buy order placed at price %.5f with SL at %.5f", price, sl_price);
      return true;
     }
  }

//+------------------------------------------------------------------+
//| Place sell order with initial stop loss                          |
//+------------------------------------------------------------------+
bool PlaceSell()
  {
   MqlTradeRequest request;
   MqlTradeResult  result;
   ZeroMemory(request);
   ZeroMemory(result);

   double price = SymbolInfoDouble(_Symbol, SYMBOL_BID);
   double sl_price = NormalizeDouble(price + InitialStopLossPoints*_Point, _Digits);

   if(sl_price <= 0.0)
     {
      Print("Invalid SL price calculated for sell.");
      return false;
     }

   request.action = TRADE_ACTION_DEAL;
   request.symbol = _Symbol;
   request.volume = Lots;
   request.type   = ORDER_TYPE_SELL;
   request.price  = price;
   request.sl     = sl_price;
   request.tp     = 0;
   request.deviation = 10;
   request.magic = ExpertHandle();

   if(!OrderSend(request, result))
     {
      PrintFormat("Sell order failed: %s", result.comment);
      return false;
     }
   else
     {
      PrintFormat("Sell order placed at price %.5f with SL at %.5f", price, sl_price);
      return true;
     }
  }

//+------------------------------------------------------------------+
//| Implement trailing stop for each position                        |
//+------------------------------------------------------------------+
void ManageTrailingStop()
  {
   for(int i=PositionsTotal()-1; i>=0; i--)
     {
      ulong ticket = PositionGetTicket(i);
      if(PositionGetInteger(POSITION_MAGIC) != ExpertHandle())
         continue; // Only handle EA's own trades

      if(!PositionSelectByTicket(ticket))
         continue;

      ENUM_POSITION_TYPE type = (ENUM_POSITION_TYPE)PositionGetInteger(POSITION_TYPE);
      double position_sl = PositionGetDouble(POSITION_SL);
      double current_price = 0.0;
      double new_sl = 0.0;

      if(type == POSITION_TYPE_BUY)
        current_price = SymbolInfoDouble(_Symbol, SYMBOL_BID);
      else if(type == POSITION_TYPE_SELL)
        current_price = SymbolInfoDouble(_Symbol, SYMBOL_ASK);
      else
        continue;

      MqlTradeRequest request;
      MqlTradeResult result;
      ZeroMemory(request);
      ZeroMemory(result);

      if(type == POSITION_TYPE_BUY)
        {
         new_sl = current_price - TrailingStopPoints * _Point;
         if(position_sl < new_sl)
           {
            request.action = TRADE_ACTION_SLTP;
            request.position = ticket;
            request.sl = NormalizeDouble(new_sl, _Digits);
            request.tp = PositionGetDouble(POSITION_TP);
            if(!OrderSend(request, result))
              {
               PrintFormat("Trailing stop modification failed (buy): %s", result.comment);
              }
            else
              {
               PrintFormat("Trailing Stop moved up for Buy to %.5f", request.sl);
              }
           }
        }
      else if(type == POSITION_TYPE_SELL)
        {
         new_sl = current_price + TrailingStopPoints * _Point;
         if(position_sl > new_sl || position_sl == 0.0)
           {
            request.action = TRADE_ACTION_SLTP;
            request.position = ticket;
            request.sl = NormalizeDouble(new_sl, _Digits);
            request.tp = PositionGetDouble(POSITION_TP);
            if(!OrderSend(request, result))
              {
               PrintFormat("Trailing stop modification failed (sell): %s", result.comment);
              }
            else
              {
               PrintFormat("Trailing Stop moved down for Sell to %.5f", request.sl);
              }
           }
        }
     }
  }

//+------------------------------------------------------------------+
//| Remove old chart objects to keep the chart clean                 |
//+------------------------------------------------------------------+
void CleanOldObjects()
  {
   if(ObjectFind(0, priceMoveLineName) != -1)
      ObjectDelete(0, priceMoveLineName);
   if(ObjectFind(0, priceMoveTextName) != -1)
      ObjectDelete(0, priceMoveTextName);
   if(ObjectFind(0, maxPosMoveTextName) != -1)
      ObjectDelete(0, maxPosMoveTextName);
   if(ObjectFind(0, maxNegMoveTextName) != -1)
      ObjectDelete(0, maxNegMoveTextName);
   if(ObjectFind(0, breakoutArrowNameBuy) != -1)
      ObjectDelete(0, breakoutArrowNameBuy);
   if(ObjectFind(0, breakoutArrowNameSell) != -1)
      ObjectDelete(0, breakoutArrowNameSell);
  }

//+------------------------------------------------------------------+
//| Draw line showing price movement                                 |
//+------------------------------------------------------------------+
void DrawPriceMoveLine(datetime time1, double price1, datetime time2, double price2)
  {
   if(ObjectFind(0, priceMoveLineName) == -1)
     {
      ObjectCreate(0, priceMoveLineName, OBJ_TREND, 0, time1, price1, time2, price2);
     }
   else
     {
      ObjectMove(0, priceMoveLineName, 0, time1, price1);
      ObjectMove(0, priceMoveLineName, 1, time2, price2);
     }

   ObjectSetInteger(0, priceMoveLineName, OBJPROP_COLOR, clrDodgerBlue);
   ObjectSetInteger(0, priceMoveLineName, OBJPROP_WIDTH, 2);
   ObjectSetInteger(0, priceMoveLineName, OBJPROP_RAY_RIGHT, false);
  }

//+------------------------------------------------------------------+
//| Draw current move speed and rate in top-left corner             |
//+------------------------------------------------------------------+
void DrawSpeedText(double pointsMoved, int secondsPassed)
  {
   string text = StringFormat("Move: %.1f pts\nTime: %d sec\nRate: %.2f pts/sec",
                              pointsMoved, secondsPassed, pointsMoved / secondsPassed);

   if(ObjectFind(0, priceMoveTextName) == -1)
     {
      ObjectCreate(0, priceMoveTextName, OBJ_LABEL, 0, 0, 0);
      ObjectSetInteger(0, priceMoveTextName, OBJPROP_CORNER, 0);      // Top-left corner
      ObjectSetInteger(0, priceMoveTextName, OBJPROP_XDISTANCE, 10);  // 10 pixels from left
      ObjectSetInteger(0, priceMoveTextName, OBJPROP_YDISTANCE, 20);  // 10 pixels from top
      ObjectSetInteger(0, priceMoveTextName, OBJPROP_FONTSIZE, 12);
      ObjectSetInteger(0, priceMoveTextName, OBJPROP_COLOR, clrWhite);
      ObjectSetInteger(0, priceMoveTextName, OBJPROP_BACK, true);
     }

   ObjectSetString(0, priceMoveTextName, OBJPROP_TEXT, text);
  }

//+------------------------------------------------------------------+
//| Draw max positive move and rate label below current stats        |
//+------------------------------------------------------------------+
void DrawMaxPosMoveText()
  {
   string text = StringFormat("Max +move: %.1f pts\nMax +rate: %.2f pts/sec", maxPosPointsMoved, maxPosRatePointsPerSec);

   if(ObjectFind(0, maxPosMoveTextName) == -1)
     {
      ObjectCreate(0, maxPosMoveTextName, OBJ_LABEL, 0, 0, 0);
      ObjectSetInteger(0, maxPosMoveTextName, OBJPROP_CORNER, 0);
      ObjectSetInteger(0, maxPosMoveTextName, OBJPROP_XDISTANCE, 10);
      ObjectSetInteger(0, maxPosMoveTextName, OBJPROP_YDISTANCE, 40); // under current stats label
      ObjectSetInteger(0, maxPosMoveTextName, OBJPROP_FONTSIZE, 12);
      ObjectSetInteger(0, maxPosMoveTextName, OBJPROP_COLOR, clrGreen);
      ObjectSetInteger(0, maxPosMoveTextName, OBJPROP_BACK, true);
     }

   ObjectSetString(0, maxPosMoveTextName, OBJPROP_TEXT, text);
  }

//+------------------------------------------------------------------+
//| Draw max negative move and rate label below positive label       |
//+------------------------------------------------------------------+
void DrawMaxNegMoveText()
  {
   string text = StringFormat("Max -move: %.1f pts\nMax -rate: %.2f pts/sec", maxNegPointsMoved, maxNegRatePointsPerSec);

   if(ObjectFind(0, maxNegMoveTextName) == -1)
     {
      ObjectCreate(0, maxNegMoveTextName, OBJ_LABEL, 0, 0, 0);
      ObjectSetInteger(0, maxNegMoveTextName, OBJPROP_CORNER, 0);
      ObjectSetInteger(0, maxNegMoveTextName, OBJPROP_XDISTANCE, 10);
      ObjectSetInteger(0, maxNegMoveTextName, OBJPROP_YDISTANCE, 60); // under positive label
      ObjectSetInteger(0, maxNegMoveTextName, OBJPROP_FONTSIZE, 12);
      ObjectSetInteger(0, maxNegMoveTextName, OBJPROP_COLOR, clrRed);
      ObjectSetInteger(0, maxNegMoveTextName, OBJPROP_BACK, true);
     }

   ObjectSetString(0, maxNegMoveTextName, OBJPROP_TEXT, text);
  }

//+------------------------------------------------------------------+
//| Draw breakout arrow on chart                                     |
//+------------------------------------------------------------------+
void DrawBreakoutArrow(bool isBuy, datetime time_, double price_)
  {
   string name = isBuy ? breakoutArrowNameBuy : breakoutArrowNameSell;
   int arrowCode = isBuy ? 233 : 234; // Wingdings arrows: 233=up, 234=down
   color clrArrow = isBuy ? clrLime : clrRed;

   // Delete old arrow
   if(ObjectFind(0, name) != -1)
      ObjectDelete(0, name);

   ObjectCreate(0, name, OBJ_ARROW, 0, time_, price_);
   ObjectSetInteger(0, name, OBJPROP_ARROWCODE, arrowCode);
   ObjectSetInteger(0, name, OBJPROP_COLOR, clrArrow);
   ObjectSetInteger(0, name, OBJPROP_WIDTH, 3);
  }

//+------------------------------------------------------------------+
//| Check price speed and trade accordingly                          |
//+------------------------------------------------------------------+
void CheckAndTrade()
  {
   // Wait for all open EA trades to close before opening new trades
   if(HasOpenPositions())
      return;

   if(!IsWithinTradingTime())
      return;

   datetime now = TimeCurrent();
   double current_price = SymbolInfoDouble(_Symbol, SYMBOL_BID);

   double points_moved = (current_price - priceAtLastCheck) / _Point;
   int time_diff = (int)(now - lastCheckTime);

   if(time_diff < CheckInterval)
      return;

   // Clear old drawings to keep chart clean on each run
   CleanOldObjects();

   // Draw line showing price move between last check and now
   DrawPriceMoveLine(lastCheckTime, priceAtLastCheck, now, current_price);

   // Draw current move stats label
   DrawSpeedText(points_moved, time_diff);

   // Calculate absolute values and rate
   double absPointsMoved = MathAbs(points_moved);
   double rate = absPointsMoved / time_diff;

   // Update max positive move and rate
   if(points_moved > 0)  // positive move
     {
      if(points_moved > maxPosPointsMoved)
         maxPosPointsMoved = points_moved;
      if(rate > maxPosRatePointsPerSec)
         maxPosRatePointsPerSec = rate;
     }
   else if(points_moved < 0) // negative move
     {
      double negMoveAbs = -points_moved; // positive absolute value
      if(negMoveAbs > maxNegPointsMoved)
         maxNegPointsMoved = negMoveAbs;
      if(rate > maxNegRatePointsPerSec)
         maxNegRatePointsPerSec = rate;
     }

   // Draw both max move labels
   DrawMaxPosMoveText();
   DrawMaxNegMoveText();

   if(points_moved >= PointsThreshold)
     {
      PrintFormat("Bullish breakout detected: Moved up %.1f points in %d seconds", points_moved, time_diff);
      DrawBreakoutArrow(true, now, current_price);

      for(int i = 0; i < TradesPerSignal; i++)
         PlaceBuy();
     }
   else if(points_moved <= -PointsThreshold)
     {
      PrintFormat("Bearish breakout detected: Moved down %.1f points in %d seconds", points_moved, time_diff);
      DrawBreakoutArrow(false, now, current_price);

      for(int i = 0; i < TradesPerSignal; i++)
         PlaceSell();
     }

   lastCheckTime = now;
   priceAtLastCheck = current_price;
  }

//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick()
  {
   ManageTrailingStop();
   CheckAndTrade();
  }

//+------------------------------------------------------------------+
//| Helper: return magic number                                       |
//+------------------------------------------------------------------+
uint ExpertHandle()
  {
   return(123456);
  }