Descargar MetaTrader 5

Aparently is fine the code, but it does not execute the order.

Para añadir comentario, por favor Autorícese o regístrese
theforce
31
theforce  

Hello everybody, I am trying to code a simple EA, if the candle shape as a Hammer o Hanging man, it should send a buy stop order. 


   extern int p = 2;
 
   double body = MathAbs(Close[1] - Open[1]);
   
    double ol = Open[1] - Low[1];
    
    double cl = Close[1] - Low[1];   
    
    int start ()
    {
         
    if( ol >= p*body && cl >= p*body) // condition for be a hammer or hanging man.
    {
   int ticket = OrderSend(Symbol(),OP_BUYSTOP,0.01,High[1]+100*Point, 2, Bid + 400*Point, Bid - 400*Point);
     
    }
    
    
    return(ticket);
    }

but when I run the EA, nothing happen.

Para añadir comentario, por favor Autorícese o regístrese