Having trouble trying to close an order

 
i am having trouble opening and closing orders.

I am using this for opening an order

int order = 0;
.....

order = OrderSend(Symbol(),OP_BUY,0.1,Ask,3,20,0,"",,0,Blue);



I cant close an order and keep getting "invalid ticket for OrderClose function"

I have been using the following to try and close the position :

 
OrderClose(OrderTicket(),OrderLots(),Ask,3,White);



Am i supposed to be using some type of function first to find the ticket number once the order is successful or am i using the OrderClose totally wrong ?

thanks

 
before use OrderTicket and OrderLots functions You need to select order with function OrderSelect
 
Thankyou Slawa