Upload folder using huggingface_hub
Browse files- streamlit_app.py +3 -43
streamlit_app.py
CHANGED
|
@@ -192,50 +192,10 @@ if models:
|
|
| 192 |
if not data['is_mock']:
|
| 193 |
send_discord_notification(symbol, data['price'], data['change'], direction)
|
| 194 |
|
| 195 |
-
# 4.
|
| 196 |
st.markdown("---")
|
| 197 |
-
|
| 198 |
-
|
| 199 |
-
with tab1:
|
| 200 |
-
# Gauge Chart for RSI
|
| 201 |
-
fig_rsi = go.Figure(go.Indicator(
|
| 202 |
-
mode = "gauge+number",
|
| 203 |
-
value = data['rsi'],
|
| 204 |
-
domain = {'x': [0, 1], 'y': [0, 1]},
|
| 205 |
-
title = {'text': "RSI Strength"},
|
| 206 |
-
gauge = {'axis': {'range': [0, 100]},
|
| 207 |
-
'bar': {'color': "darkblue"},
|
| 208 |
-
'steps': [
|
| 209 |
-
{'range': [0, 30], 'color': "lightgreen"}, # Oversold
|
| 210 |
-
{'range': [30, 70], 'color': "gray"},
|
| 211 |
-
{'range': [70, 100], 'color': "red"}], # Overbought
|
| 212 |
-
'threshold': {'line': {'color': "red", 'width': 4}, 'thickness': 0.75, 'value': data['rsi']}}))
|
| 213 |
-
st.plotly_chart(fig_rsi, use_container_width=True)
|
| 214 |
-
|
| 215 |
-
with tab2:
|
| 216 |
-
# Clustering Visualization
|
| 217 |
-
# Using approximated volatility for visualization
|
| 218 |
-
volatility = data['price'] * 0.02 # estimating 2% volatility for visualization if real calc not avail
|
| 219 |
-
cluster_features = np.array([[volatility, data['rsi']]])
|
| 220 |
-
cluster_id = models['clustering'].predict(cluster_features)[0]
|
| 221 |
-
|
| 222 |
-
st.write(f"### Current Market Regime: **Cluster {cluster_id}**")
|
| 223 |
-
if cluster_id == 0:
|
| 224 |
-
st.caption("Hypothesis: Low Volatility / Stable")
|
| 225 |
-
elif cluster_id == 1:
|
| 226 |
-
st.caption("Hypothesis: High Volatility / Risky")
|
| 227 |
-
else:
|
| 228 |
-
st.caption("Hypothesis: Transitioning")
|
| 229 |
-
|
| 230 |
-
# PCA Plot
|
| 231 |
-
pca_result = models['pca'].transform(features)
|
| 232 |
-
pc1, pc2 = pca_result[0]
|
| 233 |
-
|
| 234 |
-
fig_pca = go.Figure()
|
| 235 |
-
fig_pca.add_trace(go.Scatter(x=[0, 1, -1], y=[0, 1, -1], mode='markers', name='Regimes', marker=dict(color='gray', opacity=0.3, size=20)))
|
| 236 |
-
fig_pca.add_trace(go.Scatter(x=[pc1], y=[pc2], mode='markers', name='Current State', marker=dict(color='orange', size=25, symbol='star')))
|
| 237 |
-
fig_pca.update_layout(title="PCA Market Map", xaxis_title="PC1", yaxis_title="PC2")
|
| 238 |
-
st.plotly_chart(fig_pca, use_container_width=True)
|
| 239 |
|
| 240 |
# Footer
|
| 241 |
st.markdown("---")
|
|
|
|
| 192 |
if not data['is_mock']:
|
| 193 |
send_discord_notification(symbol, data['price'], data['change'], direction)
|
| 194 |
|
| 195 |
+
# 4. Footer
|
| 196 |
st.markdown("---")
|
| 197 |
+
# Simplified View
|
| 198 |
+
st.caption("Simplified Mode | Model: Ensemble (SVM + RF + Linear)")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 199 |
|
| 200 |
# Footer
|
| 201 |
st.markdown("---")
|