Did you define the variable inside the for loop?
Code:
for(open_trades) 
{
   // assuming no virtual hedging / pool trading
   var vPercentMAE = 100.*TradeMAE/(TradePriceOpen);   
   if(vPercentMAE > 1.0)
      exitTrade(ThisTrade);
}