¿ªÔÆÌåÓý

ctrl + shift + ? for shortcuts
© 2025 Groups.io

Multiple connections and multiple accounts


 

I have a few accounts under a Friends? and Family umbrella account which
I trade using multiple python based models.?? I had been successfully
trading two models against one of the accounts, but when I added another
model trading against a second account I ran into a problem with
account? and position updates.? I should point out that each model is
independent, requesting it's own data subscriptions and placing it's own
trades.

I had been using reqAccountUpdates() to automatically update account
values and portfolio stats.? That failed when I added the second account
because reqAccountUpdates can only be subscribed to a single account at
a time even across multiple connections.? I shifted to using
reqAccountUpdatesMulti() combined with reqPositionsMulti() in all models
and this seems to work.? The potential weakness is that one looses the
AccountReady flag with this option.

I'm wondering if I am missing something that is obvious to the veterans
on the list.? Or, a better question might be, what are others doing in
this regard?? Are you tracking account balances and position sizes
within your code rather than using api requests?? I do that in some
cases for position size but typically like to access cash balances from
the api.

While I'm asking questions let me ask one about data subscription
lines.? If hypothetically each of my three models is subscribing to the
same 10 symbols is that 10 data lines or 30?

Thanks for your thoughts,

Hugh

Join [email protected] to automatically receive all group messages.