Request expiration of a request in a exact time during the day. How to do it?

 

Hi guys!

I wish that the market cancels my request in a limit hour. Obviously, only in case that it wasn't filled.

For example, I'm sending a request to the market now (12:02:10). But There is a limit time for execution (12:03:10) - 1 minute...

I wouldn't like to send a delete message. I want that the market delete my order if it wasn't filled.

 Is it possible? Can we inform a parameter in a request to set it?

Regards! 

 
humbertobrandao:

Hi guys!

I wish that the market cancels my request in a limit hour. Obviously, only in case that it wasn't filled.

For example, I'm sending a request to the market now (12:02:10). But There is a limit time for execution (12:03:10) - 1 minute...

I wouldn't like to send a delete message. I want that the market delete my order if it wasn't filled.

 Is it possible? Can we inform a parameter in a request to set it?

Regards! 

Yes, the expiration parameter, but only if it's allowed for the symbol.
 

Thanks for your answer.

In fact, I tried to use this parameter (request.expiration), before to use the function OrderSend

request.expiration = TimeCurrent()+60;

 But, unfortunately, it doesn't work. One minute later, my pending order wasn't canceled automatically.

In this context, I don't know if I am using the parameter in the wrong way, or if it really can't work like describe in the documentation.

Do you have some tip for me?

Regards 

 
humbertobrandao:

Thanks for your answer.

In fact, I tried to use this parameter (request.expiration), before to use the function OrderSend

 But, unfortunately, it doesn't work. One minute later, my pending order wasn't canceled automatically.

In this context, I don't know if I am using the parameter in the wrong way, or if it really can't work like describe in the documentation.

Do you have some tip for me?

Regards 

Did you check that the Time Specified expiration mode is allowed for your symbol ?
Reason: