Hello
I started to learn programming. But when I check my program in strategy tester (ٍٍEvery tick) and real market , I see the difference in the result. I don't know ,why I have two exit points.
please guide me
Thanks

Difference at the exit point-as-png

PHP Code:
//Orders Counting & Close Orders------------------------------------+

   
int orderscnt=0;
for (
int  i=OrdersTotal()-i>=i--)
     {
      
//--------------------------------------
      
OrderSelect(i,SELECT_BY_POS,MODE_TRADES);
      if((
OrderSymbol()==Symbol()) && ((OrderType()==OP_SELL) || (OrderType()==OP_BUY))&& OrderMagicNumber()== MagicNumber)
        {
         
orderscnt++;
        }

      
//-Close Positione Buy if
      
if((OrderSymbol()==Symbol())  && (OrderType()==OP_BUY) &&  iBands(0,0,exite,1,0,PRICE_CLOSE,MODE_UPPER,1)<Close[1])
        {
          
OrderClose(OrderTicket(),OrderLots(),Bid,1,Black);
     
     }

      
//-Close Positione Sell if 
      
if((OrderSymbol()==Symbol()) && (OrderType()==OP_SELL) && iBands(0,0,exite,1,0,PRICE_CLOSE,MODE_LOWER,1)>Close[1])
        {
         
OrderClose(OrderTicket(),OrderLots(),Ask,1,Black);
        }
     }