Einzelnen Beitrag anzeigen
  #116 (permalink)  
Alt 20.02.16
MA-EA MA-EA ist offline
Elite Mitglied
 
Registriert seit: Sep 2015
Beiträge: 565
MA-EA befindet sich auf einem aufstrebenden Ast
Standard

Ist das richtig und logisch für den EA? Kapiert er, was er machen soll?

Code:
//Open Trade
   if (!IsInvested) {
      if (LC>GD1c && GD1c<GD2c) OrderSend(Symbol(), OP_BUY, Lots, Ask, Slippage, 0, 0, Name + " Buy(#" + MagicNumber + ")", MagicNumber, 0, Blue);
      if (LC>GD1c && LC>GD2c) OrderSend(Symbol(), OP_BUY, Lots, Ask, Slippage, 0, 0, Name + " Buy(#" + MagicNumber + ")", MagicNumber, 0, Blue);
      if (LC<GD1c && GD1c>GD2c) OrderSend(Symbol(), OP_SELL, Lots, Bid, Slippage, 0, 0, Name + " Sell(#" + MagicNumber + ")", MagicNumber, 0, Red);
      if (LC<GD1c && LC<GD2c) OrderSend(Symbol(), OP_SELL, Lots, Bid, Slippage, 0, 0, Name + " Sell(#" + MagicNumber + ")", MagicNumber, 0, Red);
   }

//Close Trade
   if (IsInvested) {
    for (i=OrdersTotal()-1; i>=0; i--) {
      if (OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) {
         if (OrderType()==OP_BUY && OrderMagicNumber()==MagicNumber && OrderSymbol()==Symbol()) {
            if(LC<GD1c) OrderClose(OrderTicket(), OrderLots(), Bid, Slippage, DarkBlue);
         }  
         if (OrderType()==OP_BUY && OrderMagicNumber()==MagicNumber && OrderSymbol()==Symbol()) {            
            if(LC<GD2c) OrderClose(OrderTicket(), OrderLots(), Bid, Slippage, DarkBlue);
         }
         if (OrderType()==OP_SELL && OrderMagicNumber()==MagicNumber && OrderSymbol()==Symbol()) {
            if(LC>GD1c) OrderClose(OrderTicket(), OrderLots(), Ask, Slippage, FireBrick);
         }  
         if (OrderType()==OP_SELL && OrderMagicNumber()==MagicNumber && OrderSymbol()==Symbol()) {            
            if(LC>GD2c) OrderClose(OrderTicket(), OrderLots(), Ask, Slippage, FireBrick);
         } 
      }
    }    
   }
         
 return(0);
}