Check Pending trade

Bernard Ho  

I had backtest my multisymbol EA using strategy tester. The code below is suppose to check if the symbol has already been placed under pending order, it will not allow trade for that symbol. However, when I select, eg. "USDEUR" or "USDCAD", to back test at the strategy tester. only the selected pair will not work. (I hope you all understand what I mean) Rest of all pairs will work for this part of the code. I have attached my Screenshots so you can understand what I mean better.

Am I missing something? Have been thinking about it for a few days but could not figure it out the rest. Please Help!!! 

   #include <Trade\Trade.mqh>
   #include <Trade\OrderInfo.mqh>
   CTrade trade;
   COrderInfo orderinfo;

for(int x=maxNoOfTrades; x > -1; x--)
{
   PassTrade = true;
   orderinfo.SelectByIndex(x);
   ChkPend=orderinfo.Symbol();
   
   if(ChkPend==SymToTrade[i])
   {
      PassTrade = false;
      break;
   }
 }
Keith Watford  
Please edit your post and use the code button (Alt+S) when pasting code.
EDIT your original post, please do not just post the code correctly in a new post.
Reason: