Invalid Price MT5

 

 

Why this Invalid Price error ?

I dont see anything wrong. 

 
Maybe the ask price was higher than the order at the time order were send.
 
Damian Mateusz Dziadosz:
Maybe the ask price was higher than the order at the time order were send.
         mrequest.action = TRADE_ACTION_PENDING;                               
         mrequest.price = NormalizeDouble(p_high1,_Digits);
         
         mrequest.tp = NormalizeDouble(p_high1 + TKP*_Point,_Digits);
         mrequest.sl = NormalizeDouble(p_low1*_Point,_Digits);
          
       
         mrequest.symbol = _Symbol;                                          
         mrequest.volume = Lot;                                              
         mrequest.magic = EA_Magic;                                          
         mrequest.type = ORDER_TYPE_BUY_STOP;                                      
         mrequest.type_filling = ORDER_FILLING_IOC;
         mrequest.deviation=0; 


I want to the EA buy when the price get the higher price of the previous candle that the cross the MA !

But sometimes i get this Invalid Price Error 

Reason: