fix: Handle missing trade direction by defaulting to 'Buy'

This commit is contained in:
Bobby (aider) 2025-02-13 08:43:41 -08:00
parent fb27bf3003
commit c030f87d9a

View File

@ -321,7 +321,7 @@ def trading_journal_page():
else:
st.metric("Entry Price", f"${trade['entry_price']:.2f}")
st.metric("Shares", trade['shares'])
st.metric("Type", trade['direction'].capitalize())
st.metric("Type", trade.get('direction', 'Buy').capitalize())
with col2:
if trade['direction'] == 'buy':