fix: Handle potential type conversion errors for exit price in trading journal
This commit is contained in:
parent
287dd32485
commit
b8a561f37c
@ -334,7 +334,12 @@ def trading_journal_page():
|
||||
if trade.get('stop_loss'):
|
||||
st.metric("Stop Loss", f"${trade['stop_loss']:.2f}")
|
||||
if trade.get('exit_price'):
|
||||
st.metric("Exit Price", f"${trade['exit_price']:.2f}")
|
||||
try:
|
||||
exit_price = float(trade['exit_price'])
|
||||
st.metric("Exit Price", f"${exit_price:.2f}")
|
||||
st.metric("Exit Date", format_datetime(trade['exit_date']))
|
||||
except (ValueError, TypeError):
|
||||
st.metric("Exit Price", "N/A")
|
||||
st.metric("Exit Date", format_datetime(trade['exit_date']))
|
||||
|
||||
if trade.get('strategy'):
|
||||
|
||||
Loading…
Reference in New Issue
Block a user