Populating order collection
Atom
11/1/2017


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

Tags:


Thanks: Support




5 Answers
Support

Avatar
Date: 11/2/2017
Reply


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.
Thanks:

Johan Kirsten

Avatar
Date: 11/2/2017
Reply


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
Topic starter
Thanks:

Support

Avatar
Date: 11/2/2017
Reply


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.co...fe-a829-fa6c40e5fabd.htm
Thanks:

Johan Kirsten

Avatar
Date: 11/2/2017
Reply


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

Topic starter
Thanks:

Support

Avatar
Date: 11/2/2017
Reply


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.
Thanks:


Attach files by dragging & dropping, , or pasting from the clipboard.

loading
clippy