ratulsur commited on
Commit
27109fd
Β·
verified Β·
1 Parent(s): 95d5148

Update pages/predictions.py

Browse files
Files changed (1) hide show
  1. pages/predictions.py +7 -3
pages/predictions.py CHANGED
@@ -11,13 +11,17 @@ quantum_optimizer = QuantumInspiredOptimizer()
11
  st.set_page_config(page_title="Market Predictions", layout="wide")
12
  st.title("πŸ“ˆ Market Predictions with Quantum Insights")
13
 
14
- # 🎯 Load Available Individual Stocks (Not Sectors)
15
- available_stocks = load_nifty50_symbols() # Ensure this returns a list of tickers
 
 
 
 
16
 
17
  # βœ… Ensure Default Stock Exists
18
  default_stock = ["RELIANCE.NS"] if "RELIANCE.NS" in available_stocks else []
19
 
20
- # 🎯 Stock Selection (No Sectors, Only Stocks)
21
  selected_stocks = st.multiselect("Select Stock(s)", available_stocks, default=default_stock)
22
  prediction_days = st.slider("Prediction Window (days)", 5, 30, 7)
23
 
 
11
  st.set_page_config(page_title="Market Predictions", layout="wide")
12
  st.title("πŸ“ˆ Market Predictions with Quantum Insights")
13
 
14
+ # 🎯 Load Available Stocks (Ensure This Returns Tickers, Not Sectors)
15
+ available_stocks = load_nifty50_symbols()
16
+
17
+ # βœ… If sectors are still appearing, flatten the structure
18
+ if isinstance(available_stocks, dict): # If dictionary (sectors)
19
+ available_stocks = [stock for sector in available_stocks.values() for stock in sector]
20
 
21
  # βœ… Ensure Default Stock Exists
22
  default_stock = ["RELIANCE.NS"] if "RELIANCE.NS" in available_stocks else []
23
 
24
+ # 🎯 Stock Selection (Only Individual Stocks)
25
  selected_stocks = st.multiselect("Select Stock(s)", available_stocks, default=default_stock)
26
  prediction_days = st.slider("Prediction Window (days)", 5, 30, 7)
27