From aec48a1dd5032c5f40640bc8dfb4506ad435a793 Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Thu, 23 Jun 2022 15:07:56 -0400 Subject: [PATCH] Right, zero sized "closed out" msgs are totally fine --- piker/brokers/ib/broker.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/piker/brokers/ib/broker.py b/piker/brokers/ib/broker.py index b6d780de..11f43a6f 100644 --- a/piker/brokers/ib/broker.py +++ b/piker/brokers/ib/broker.py @@ -414,6 +414,12 @@ async def update_and_audit_msgs( size=p.size, avg_price=p.be_price, ) + if validate and p.size: + raise ValueError( + f'UNEXPECTED POSITION ib <-> piker ledger:\n' + f'piker: {msg}\n' + 'YOU SHOULD FIGURE OUT WHY TF YOUR LEDGER IS OFF!?!?' + ) msgs.append(msg) return msgs