Ensure that the limit price is always a positive number
This commit is contained in:
parent
5be5867c47
commit
83a008f981
@ -3,5 +3,5 @@ from ib_insync import Trade
|
|||||||
class OptionOrder:
|
class OptionOrder:
|
||||||
|
|
||||||
def __init__(self, trade_result: Trade):
|
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)
|
self.fill_price = abs(trade_result.orderStatus.avgFillPrice)
|
Loading…
Reference in New Issue
Block a user