diff --git a/src/trading/journal.py b/src/trading/journal.py index f7aa34c..f0df50c 100644 --- a/src/trading/journal.py +++ b/src/trading/journal.py @@ -57,13 +57,15 @@ def handle_sell_order(ticker: str, shares_to_sell: int, exit_price: float, exit_ if shares_from_position == position['shares']: # Close entire position - update_trade_exit( + update_trade( trade_id=position['id'], - exit_price=exit_price, - exit_date=exit_date, - followed_rules=followed_rules, - exit_reason=exit_reason, - notes=notes + updates={ + 'exit_price': exit_price, + 'exit_date': exit_date, + 'followed_rules': 1 if followed_rules else 0, + 'exit_reason': exit_reason, + 'notes': notes + } ) else: # Split position: update original position with remaining shares