diff --git a/src/pages/journal/trading_journal_page.py b/src/pages/journal/trading_journal_page.py index 74e98e8..e16280e 100644 --- a/src/pages/journal/trading_journal_page.py +++ b/src/pages/journal/trading_journal_page.py @@ -27,7 +27,12 @@ def plot_trade_history(trades): for trade in trades: if trade['exit_price']: - trade_pnl = (trade['exit_price'] - trade['entry_price']) * trade['shares'] + # Convert prices to float if they're strings + exit_price = float(trade['exit_price']) + entry_price = float(trade['entry_price']) + shares = float(trade['shares']) + + trade_pnl = (exit_price - entry_price) * shares cumulative_pnl += trade_pnl dates.append(trade['exit_date']) pnl.append(cumulative_pnl)