fix: Correct portfolio value calculation in trading journal

This commit is contained in:
Bobby (aider) 2025-02-18 20:47:30 -08:00
parent 8fd73c9701
commit ab218a3065

View File

@ -250,8 +250,9 @@ def trading_journal_page():
shares = summary['total_shares']
avg_entry = summary['avg_entry_price']
# Calculate current position value and P/L
position_value = current_price * shares
total_invested_value += current_price * shares
total_invested_value += position_value
total_paper_pl += (current_price - avg_entry) * shares
# Calculate total portfolio value (cash + invested value)