diff --git a/src/streamlit_app.py b/src/streamlit_app.py index 4c8f2e6..8ae8116 100644 --- a/src/streamlit_app.py +++ b/src/streamlit_app.py @@ -587,6 +587,19 @@ def trading_system_page(): # Initialize portfolio if not in session state if 'portfolio' not in st.session_state: st.session_state.portfolio = Portfolio() + + # Load existing open trades into portfolio + open_trades = get_open_trades() + for trade in open_trades: + position = Position( + symbol=trade['ticker'], + entry_date=trade['entry_date'], + entry_price=trade['entry_price'], + shares=trade['shares'], + stop_loss=trade['stop_loss'], + target_price=trade['target_price'] + ) + st.session_state.portfolio.add_position(position) # Add position form with st.expander("Add New Position"):