Skip to content

Commit

Permalink
fix wrong OrderStatus in BalanceTracker
Browse files Browse the repository at this point in the history
  • Loading branch information
jordantete committed Jan 8, 2025
1 parent 617f96b commit 74826d0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/order_handling/balance_tracker.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,8 @@ def update_after_initial_purchase(self, initial_order: Order):
Args:
initial_order: The Order object containing details of the completed purchase.
"""
if initial_order.status != OrderStatus.FILLED:
raise ValueError(f"Order {initial_order.id} is not FILLED. Cannot update balances.")
if initial_order.status != OrderStatus.CLOSED:
raise ValueError(f"Order {initial_order.id} is not CLOSED. Cannot update balances.")

total_cost = initial_order.filled * initial_order.average
fee = self.fee_calculator.calculate_fee(initial_order.amount * initial_order.average)
Expand Down

0 comments on commit 74826d0

Please sign in to comment.