sending out orders

 

Question:


When my script opens an order, does it wait until the order is placed before it continues on with the rest of the script? It feels like there is an overlap. like the script goes on without even any confirmation that the order was placed. Can someone enlighten me or point me in the right direction?

Thanks!

 
heyarn:

Question:


When my script opens an order, does it wait until the order is placed before it continues on with the rest of the script? It feels like there is an overlap. like the script goes on without even any confirmation that the order was placed. Can someone enlighten me or point me in the right direction?

Thanks!

Hi,

The best way to do when you execute an OrderSend command (or any other I/O command) is to check the return code. By doing this you will always know how your command has been executed.

To answer your question : programs are executed step by step = command after command = order after order. So when you execute an OrderSend command it is executed completly before starting to execute the next order. That doesn't mean your order has been opened. It could result in an error (due to timeout, server busy, connection problem,... )

One easy way to check if your order has been placed is to check the value of the ticket you get in return. If it is equal to zero, then your order is not placed.

Reason: