From d29e9eeb31fe39241e33d471f40da6fc3e4fcd91 Mon Sep 17 00:00:00 2001 From: Tyler Goodlet Date: Mon, 10 Apr 2023 22:17:27 -0400 Subject: [PATCH] Only flip size sign for seels if not already -ve --- piker/clearing/_paper_engine.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/piker/clearing/_paper_engine.py b/piker/clearing/_paper_engine.py index 02031898..23e1d347 100644 --- a/piker/clearing/_paper_engine.py +++ b/piker/clearing/_paper_engine.py @@ -124,7 +124,10 @@ class PaperBoi(Struct): # in the broker trades event processing loop await trio.sleep(0.05) - if action == 'sell': + if ( + action == 'sell' + and size > 0 + ): size = -size msg = BrokerdStatus(