View Single Post
 
Old 02-22-2008, 09:17 PM
matrixebiz's Avatar
matrixebiz matrixebiz is offline
Senior Member
 
Join Date: Oct 2006
Posts: 1,159
matrixebiz is on a distinguished road
Ok, thank you for responding. Don't really code at all. Just learning some basic stuff. So to kill two birds with one stone, could I do?;

Code:
//Check position
   bool IsTrade = False;

   for (int i = 0; i < Total; i ++) {
      OrderSelect(i, SELECT_BY_POS, MODE_TRADES);
      if(OrderType() <= OP_SELL && OrderMagicNumber()==MagicNumber &&  OrderSymbol() == Symbol()) {
         // IsTrade = True;
         IsTrade = False;
         if(OrderType() == OP_BUY) {
            //Close
or just delete this line if(!IsTrade) { from the Buy and Sell entry commands
but still add && OrderMagicNumber()==MagicNumber


EDIT: if I remove the if(!IsTrade) { and the EA trades more times that will screw up my close command because I wont have away of tracking what trade I want to close If I have two E/J trades open how can I decipher between the two ?? Ok, maybe I just leave that part alone and have one order at a time

Last edited by matrixebiz; 02-22-2008 at 09:30 PM.