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']:
# 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