Profile Picture

TWS Plugin question on SyncAccount and SetAccount

Posted By roedies 4 Years Ago
Message
Posted Friday May 31 2013
Hi,

I'm using RE v48 and TWSplugin for trading.

I would like to synchronise from time to time my IB account with RE positions. I believe the "SyncAccountState" and "SetAccountState" should be helpful here.

I' ve logic in the Newbar on the system level to run the SyncAccountState method on regular intervals. In the TWSlog I see this is executed but no sync between IB and my RE positions occur.

Same for SetAccounState. Setting the BrokerAccountState.BrokerOverride = true doesn't do anything. Inspecting the TWSPlugin code delivered I can't find any code using this BrokerAccountState.BrokerOverride.

Am I doing something wrong or is this synchronization functionality not yet fully implemented in the current TWSplugin?

Can RE provide some code snippets / approach to start this synchronisation development effort.

regrds

roedies

Posted Sunday June 02 2013
Those methods are called during the startup of your system to sync the state with that of the broker. They aren't meant to be called by your system while it is running.

The idea is, when you start your live system it should sync with TWS to update any orders that were cancelled or filled while it was disconnected. While connected, TWS should send any order updates to RightEdge so it should stay in sync.

The big exception to this is that RightEdge doesn't track orders that it didn't submit. So if you submit an order through TWS (or through another program) RightEdge won't know anything about it.

Does this explain things for you?

Thanks,
Daniel


Similar Topics


Reading This Topic


2005-2017 © RightEdge Systems