Do something only if order is opened successfully?

 
int oldSellEntry = 0;
if(OrderSend(_Symbol,OP_SELLLIMIT , NormalizeDouble( sellLot ,2 ), ighest1,3, SL_TMP, TP_TMP, "1" ,0,0,Red))
{   
         oldSellEntry = 555;
}

print (oldSellEntry); // Why output is 555 even if no trade is open?

How to make sure Ordersend() successful before assign value "555" to variable oldSellEntry?

 
hey bro
 
Eng Keat Ang:

How to make sure Ordersend() successful before assign value "555" to variable oldSellEntry?

I think the answer should be :

int sellCheck1 = OrderSend(_Symbol,OP_SELLLIMIT , NormalizeDouble( sellLot ,2 ), ighest1,3, SL_TMP, TP_TMP, "1" ,0,0,Red)

if(sellCheck1 > 0)
{   
         oldSellEntry = 555;
}

But i remember i read somewhere saying OrderSend function must with if statement otherwise new version of mt4 causes error. But I don't know how to put if statement on orderSend

 
Eng Keat Ang #: But i remember i read somewhere saying OrderSend function must with if statement
  1. You remember wrong.
  2. OrderSend does not return a boolean.
Reason: