Update pages/predictions.py
Browse files- 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
|
| 15 |
-
available_stocks = load_nifty50_symbols()
|
|
|
|
|
|
|
|
|
|
|
|
|
| 16 |
|
| 17 |
# β
Ensure Default Stock Exists
|
| 18 |
default_stock = ["RELIANCE.NS"] if "RELIANCE.NS" in available_stocks else []
|
| 19 |
|
| 20 |
-
# π― Stock Selection (
|
| 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 |
|