From 83a008f981eb7844b326d4d4bfecbb851516b757 Mon Sep 17 00:00:00 2001 From: moshferatu Date: Tue, 20 Feb 2024 07:47:47 -0800 Subject: [PATCH] Ensure that the limit price is always a positive number --- ibkr/option_order.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ibkr/option_order.py b/ibkr/option_order.py index a832ddc..374e2e1 100644 --- a/ibkr/option_order.py +++ b/ibkr/option_order.py @@ -3,5 +3,5 @@ from ib_insync import Trade class OptionOrder: def __init__(self, trade_result: Trade): - self.limit_price = trade_result.order.lmtPrice + self.limit_price = abs(trade_result.order.lmtPrice) self.fill_price = abs(trade_result.orderStatus.avgFillPrice) \ No newline at end of file