From f1289ccce2124320f9059eea2c4c40115e5ded8e Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Wed, 26 Jul 2023 14:55:17 -0400 Subject: [PATCH] ib: Oof, right need to create ledger entries too.. --- piker/brokers/ib/broker.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/piker/brokers/ib/broker.py b/piker/brokers/ib/broker.py index e9c6c83f..b32f4eac 100644 --- a/piker/brokers/ib/broker.py +++ b/piker/brokers/ib/broker.py @@ -857,10 +857,9 @@ async def emit_pp_update( ledger: dict = ledgers[acctid] # NOTE: don't override flex/previous entries with new API - # ones, just update with new fields! + # ones, just update with new fields or create new entry. for tid, tdict in trades_by_id.items(): - # ledger.setdefault(tid, {}).update(tdict) - ledger[tid].update(tdict) + ledger.setdefault(tid, {}).update(tdict) # generate pp msgs and cross check with ib's positions data, relay # re-formatted pps as msgs to the ems.