pikers / piker

(e2e) foss trading for non-tinas
GNU Affero General Public License v3.0
103 stars 17 forks source link

Ib dedicated data client #321

Closed goodboy closed 2 years ago

goodboy commented 2 years ago

Adds a new policy for the ib backend which insists the user must choose a priority for a "data client' connection: a specific (set of) client(s) which is anticipated to be used for data feeds, history loading, and symbol search as opposed to just for orders / trading.

The user must now add a brokers.toml section which determines the data client priority by order of account name:

# when clients are being scanned this determines
# which clients are preferred to be used for data
# feeds based on the order of account names, if
# detected as active on an API client.
prefer_data_account = [
    'paper',
    'margin',
    'ira',
]

The main motivation for this is to eventually allow users to run less sensitive API gateways on remote hosts which do data work whilst keeping more sensitive live gateway nodes local (or on diff hosts). This also paves the way for being able to do targetted data resets without resetting gws which are only doing orders. Further this is just more specific about which API node is doing what.


Other tidbits: