fix: Handle potential type conversion errors for exit price in trading journal
This commit is contained in:
parent
287dd32485
commit
b8a561f37c
@ -334,8 +334,13 @@ def trading_journal_page():
|
|||||||
if trade.get('stop_loss'):
|
if trade.get('stop_loss'):
|
||||||
st.metric("Stop Loss", f"${trade['stop_loss']:.2f}")
|
st.metric("Stop Loss", f"${trade['stop_loss']:.2f}")
|
||||||
if trade.get('exit_price'):
|
if trade.get('exit_price'):
|
||||||
st.metric("Exit Price", f"${trade['exit_price']:.2f}")
|
try:
|
||||||
st.metric("Exit Date", format_datetime(trade['exit_date']))
|
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'):
|
if trade.get('strategy'):
|
||||||
st.text(f"Strategy: {trade['strategy']}")
|
st.text(f"Strategy: {trade['strategy']}")
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user