OrderModify() Error 130

 

I have this type of error in this function, why happening?


// Trailing Stop per gli ordini #5 e #6 (Stop loss modify a Break Even)
void TrailingStop1Sell(){    

  
  if (ticket5 > 0){  // seleziona l'ordine #5 se è presente
  
    if (OrderSelect(ticket5,SELECT_BY_TICKET)){    // verifica se l'ordine è aperto
                  
          if (OrderStopLoss() != OrderOpenPrice()){   // verifica se lo SL è già stato spostato
          
             if (!OrderModify(ticket5,OrderOpenPrice(),OrderOpenPrice(),OrderTakeProfit(),OrderExpiration(),clrViolet)){  // modifica ordine #5 con SL uguale a Break even (prezzo d'entrata)
                
                      
                stampa("Errore in OrderModify per Trailing Stop dell'ordine #5 ", GetLastError());
                
             }
          
          }
                 
       }
       
         
    }  
  
    else {                 // ordine chiuso 
     
       return;   
       
       }
     




 
You can't move stops closer to the market than MODE_STOPLEVEL. Requirements and Limitations in Making Trades - Appendixes - MQL4 Tutorial
 
whroeder1:
You can't move stops closer to the market than MODE_STOPLEVEL. Requirements and Limitations in Making Trades - Appendixes - MQL4 Tutorial


Yes, resolved, was a condition issue in the call of function.

Thanks

Giovanni

Reason: