fix: Handle non-string trade direction in trading journal display
This commit is contained in:
parent
c030f87d9a
commit
287dd32485
@ -321,7 +321,11 @@ def trading_journal_page():
|
||||
else:
|
||||
st.metric("Entry Price", f"${trade['entry_price']:.2f}")
|
||||
st.metric("Shares", trade['shares'])
|
||||
st.metric("Type", trade.get('direction', 'Buy').capitalize())
|
||||
direction = trade.get('direction')
|
||||
if isinstance(direction, str):
|
||||
st.metric("Type", direction.capitalize())
|
||||
else:
|
||||
st.metric("Type", "Buy")
|
||||
|
||||
with col2:
|
||||
if trade['direction'] == 'buy':
|
||||
|
||||
Loading…
Reference in New Issue
Block a user