fix: Replace undefined update_trade_exit with update_trade

This commit is contained in:
Bobby (aider) 2025-02-10 18:47:55 -08:00
parent 3819547de7
commit 3e57a678f7

View File

@ -57,13 +57,15 @@ def handle_sell_order(ticker: str, shares_to_sell: int, exit_price: float, exit_
if shares_from_position == position['shares']: if shares_from_position == position['shares']:
# Close entire position # Close entire position
update_trade_exit( update_trade(
trade_id=position['id'], trade_id=position['id'],
exit_price=exit_price, updates={
exit_date=exit_date, 'exit_price': exit_price,
followed_rules=followed_rules, 'exit_date': exit_date,
exit_reason=exit_reason, 'followed_rules': 1 if followed_rules else 0,
notes=notes 'exit_reason': exit_reason,
'notes': notes
}
) )
else: else:
# Split position: update original position with remaining shares # Split position: update original position with remaining shares