Posted 5/12/2011 00:41:21
|
|
|
|
dwebber (5/5/2011) As a further update, I resolved the issue above via a separate dll that includes a singleton. Kvps from UpdateAccountValueEventArgs in the TWSPlugin are saved in the singleton and retrieved in the strategy.
A few minor issues are still outstanding such as:
1. the fact that the IB account values are not updated until after positions change in the account (causing values to be missing upon startup), and
2. not being able to update account values for each account in an FA account (the IB api is only sending updates for the last account requested).
I think you can resolve these issues by having the singleton have a reference back to the TWS plugin instance. Then you can call a method on the singleton to have the TWS plugin request account updates, and probably also to specify which account you want the values for.
Thanks,
Daniel
|
|
Posted 5/12/2011 10:26:34
|
|
|
|
Issue #2 above appears to be resolvable by calling client.RequestUpdates at each point an update is need, e.g., after an order status has been updated in client_OrderStatus.
Regarding the 1st issue: Currently, Startup is called before setting bool brokerConnect = true in TWSPlugin.Connect(). Can the broker be connected before Startup is called in order to obtain account variables in which the system is dependent upon, e.g., available cash? Without connecting to the broker first, a call to client.RequestAccountUpdates will not trigger updates.
Thanks, Duane
|
|
Posted 5/13/2011 00:39:22
|
|
|
|
When you start a live system, the broker used is the paper broker until the lead bars finish and switch to live mode. We might consider changing this, but not for RE 2010. Can you have your system wait until the account variables come in before enabling trading?
Thanks,
Daniel
|
|
Posted 5/13/2011 13:26:50
|
|
|
|
I was able to resolve the issue through a combination of delayed order processing and checks in the script. I appreciate your support.
Duane
|
|
|
|