fix: Correct portfolio value calculation in trading journal
This commit is contained in:
parent
8fd73c9701
commit
ab218a3065
@ -250,8 +250,9 @@ def trading_journal_page():
|
|||||||
shares = summary['total_shares']
|
shares = summary['total_shares']
|
||||||
avg_entry = summary['avg_entry_price']
|
avg_entry = summary['avg_entry_price']
|
||||||
|
|
||||||
|
# Calculate current position value and P/L
|
||||||
position_value = current_price * shares
|
position_value = current_price * shares
|
||||||
total_invested_value += current_price * shares
|
total_invested_value += position_value
|
||||||
total_paper_pl += (current_price - avg_entry) * shares
|
total_paper_pl += (current_price - avg_entry) * shares
|
||||||
|
|
||||||
# Calculate total portfolio value (cash + invested value)
|
# Calculate total portfolio value (cash + invested value)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user