Profile Picture

TWSPlugin modification for per account trades

Posted By alpha23 6 Years Ago
Message
Posted Tuesday May 03 2011
I’m modifying the TWSPlugin for use in an FA account to allow trades to be executed on an account basis (versus groups or profile). The trades are executing in TWS and recognized by RE during a trading session. However, on a system restart, the open orders are not recognized resulting in an exception because Dictionary openOrders count = 0. Which methods need to be modified in order to populate openOrders when starting a live system with existing orders?

Note: I looked at the SetAccountState method in the plugin; however, Positions in BrokerAccountState does not appear to contain all the necessary properties.

Thanks, Duane
Posted Wednesday May 04 2011
What is calling into the broker causing the exception? When you start a live system you should have the option to use the saved position/order state. RightEdge will run your system in simulation mode for the lead bars, then create the live broker, call SetAccountState, and then call Connect. The call to SetAccountState should give you the orders to populate the broker's open order list. Are you trying to get the open orders while still in the lead bars?

Thanks,
Daniel
Posted Wednesday May 04 2011
It appears that there were other issues occurring in my script. I was able to modify the TWSPlugin to work with individual accounts.

Duane


Similar Topics


Reading This Topic


2005-2017 © RightEdge Systems