← Atrás

Populating order collection

Hi

How do I get Orders collection on connector populated with my open orders after connecting the connector? (i.e. if I have open orders on application startup and want to access them through Orders collection)

Regards

¿Le resultó útil este tema?

Compartir tema

Comentarios (5)

Iniciar sesión o Crear cuenta, Inicie sesión o regístrese para dejar un comentario

Support
Support

Hello, Johan

The request sends automatically while connected. The trigger IConnector.NewOrder should be fired every time when new row occur in TWS. The same will be for own trades.

Johan Kirsten
Johan Kirsten Autor

Hi

Thank you, but what about the case where I:

  1. submit order, receiving NewOrder gets fired
  2. my app crashes
  3. I restart the app

How does Orders collection on connector get populated after restart?

Regards

Support
Support

All order's info can be downloaded from 2 sources. 1 - from brokerage connection (in your case TWS). 2 - from local storage. TWS keep filled orders for 1 day so you will get necessary orders after restart automatically.

If you prefer to keep orders history more that 1 day we recommend to use our storage - http://doc.stocksharp.com/html/7a8a9518-6270-4cfe-a829-fa6c40e5fabd.htm

Johan Kirsten
Johan Kirsten Autor

Hi

And what about MyTrades collection? Is it also filled after restart automatically? I.e if I have open trades in TWS and then start S# will MyTrades be filled automatically?

Regards

Support
Support

The same with orders - automatically. Connector ask destination source for orders and my trades. If the source (TWS) send it - you will get it in your strategy.