Tips on limiting new orders with multiple charts?

 

I made an EA with a logic that its entries only opens on new candles. I've also set a limit on how many orders should be only be open at the same time.

See this example portion of my code:

bool CheckForNewBar()
  {
   static int LastNumberOfBars;
   bool NewBarAppeared = false;

   if(Bars>LastNumberOfBars)
     {
      NewBarAppeared = true;
      LastNumberOfBars = Bars;
     }

   return NewBarAppeared;
  }

void OnTick()
{
	if (CheckForNewBar() && OrdersTotal() < 3)
	{
	//Entry Strategy Here
	}
}

But with this, SOMETIMES there are times that there are more 3 orders open simultaneously. My code prohibits the EA from opening more entries IF there are already 3 orders from 3 different currency pairs, but it does not stop the EA from entering more than 3 if all unique charts has the same intention.

Would putting a different amount of delay/sleep for each chart work? Thanks in advance!