I need some code help to place one trade per pair (But no more)

 

My code is set up to be placed on only one pair, but it will trade on multiple. For instance...

*Not Entire Code*

//-----------------------------------------------------------------

  {

    if(gbp>0)

      {

        if(gbp-usd<(TradePoints*(-1)+1))

          {

            result=OrderSend("GBPUSD",OP_BUY,.5,gbpusdask,3,gbpusdbid-iATR("GBPUSD",240,6,0),gbpusdask+iATR("GBPUSD",240,6,0),"The Real Thing",MagicNumber,0,Blue);

            return(0);

          }

      }

  }

  {

    if(gbp<0)

      {

        if(gbp-usd<(TradePoints*(-1)+1))

          {

            result=OrderSend("GBPUSD",OP_SELL,.5,gbpusdask,3,gbpusdask+iATR("GBPUSD",240,6,0),gbpusdbid-iATR("GBPUSD",240,6,0),"The Real Thing",MagicNumber,0,Blue);

            return(0);

          }

      }

  }

//-------------------------------------------------------

Is there a statement I can place before each section like this one that will make it so it won't place more than one trade one each pair. But still allows a trade on each pair?

 
fly2hi:

My code is set up to be placed on only one pair, but it will trade on multiple. For instance...

*Not Entire Code*

//-----------------------------------------------------------------

  {

    if(gbp>0)

      {

        if(gbp-usd<(TradePoints*(-1)+1))

          {

            result=OrderSend("GBPUSD",OP_BUY,.5,gbpusdask,3,gbpusdbid-iATR("GBPUSD",240,6,0),gbpusdask+iATR("GBPUSD",240,6,0),"The Real Thing",MagicNumber,0,Blue);

            return(0);

          }

      }




https://www.mql5.com/en/charts/9477807/eurusd-d1-liteforex-investments-limited

 result=OrderSend("GBPUSD",OP_BUY,.01,MarketInfo("GBPUSD",MODE_ASK),3,MarketInfo("GBPUSD",MODE_BID)-iATR("GBPUSD",240,6,0)*MarketInfo("GBPUSD",MODE_POINT),MarketInfo("GBPUSD",MODE_ASK)+iATR("GBPUSD",240,6,0)*MarketInfo("GBPUSD",MODE_POINT),"The Real Thing",MagicNumber,0,Blue);

    result=OrderSend("GBPUSD",OP_SELL,.01,MarketInfo("GBPUSD",MODE_BID),3,MarketInfo("GBPUSD",MODE_ASK)+iATR("GBPUSD",240,26,0)*MarketInfo("GBPUSD",MODE_POINT),MarketInfo("GBPUSD",MODE_BID)-iATR("GBPUSD",240,26,0)*MarketInfo("GBPUSD",MODE_POINT),"The Real Thing",MagicNumber,0,Blue);

  }

  {

    if(gbp<0)

      {

        if(gbp-usd<(TradePoints*(-1)+1))

          {

            result=OrderSend("GBPUSD",OP_SELL,.5,gbpusdask,3,gbpusdask+iATR("GBPUSD",240,6,0),gbpusdbid-iATR("GBPUSD",240,6,0),"The Real Thing",MagicNumber,0,Blue);

            return(0);

          }

      }

  }

//-------------------------------------------------------

Is there a statement I can place before each section like this one that will make it so it won't place more than one trade one each pair. But still allows a trade on each pair?

Reason: