import random from datetime import datetime, timedelta import pandas as pd import plotly.graph_objects as go import streamlit as st from frontend.st_utils import initialize_st_page initialize_st_page( layout="wide", show_readme=False ) # Custom CSS for enhanced styling st.markdown(""" """, unsafe_allow_html=True) # Hero Section st.markdown("""

๐Ÿค– Hummingbot Dashboard

Your Command Center for Algorithmic Trading Excellence

""", unsafe_allow_html=True) # Generate sample data for demonstration def generate_sample_data(): """Generate sample trading data for visualization""" dates = pd.date_range(start=datetime.now() - timedelta(days=30), end=datetime.now(), freq='D') # Sample portfolio performance portfolio_values = [] base_value = 10000 for i in range(len(dates)): change = random.uniform(-0.02, 0.03) # -2% to +3% daily change base_value *= (1 + change) portfolio_values.append(base_value) return pd.DataFrame({ 'date': dates, 'portfolio_value': portfolio_values, 'daily_return': [random.uniform(-0.05, 0.08) for _ in range(len(dates))] }) # Quick Stats Dashboard st.markdown("## ๐Ÿ“Š Live Dashboard Overview") # Mock data warning st.warning(""" โš ๏ธ **Demo Data Notice**: The metrics, charts, and statistics shown below are simulated/mocked data for demonstration purposes. This showcases how real trading data would be presented in the dashboard once connected to live trading bots. """) col1, col2, col3, col4 = st.columns(4) with col1: st.markdown("""

๐Ÿ”„ Active Bots

3

Currently Trading

""", unsafe_allow_html=True) with col2: st.markdown("""

๐Ÿ’ฐ Total Portfolio

$12,847

+2.3% Today

""", unsafe_allow_html=True) with col3: st.markdown("""

๐Ÿ“ˆ Win Rate

74.2%

Last 30 Days

""", unsafe_allow_html=True) with col4: st.markdown("""

โšก Total Trades

1,247

This Month

""", unsafe_allow_html=True) st.divider() # Performance Chart col1, col2 = st.columns([2, 1]) with col1: st.markdown("### ๐Ÿ“ˆ Portfolio Performance (30 Days)") # Generate and display sample performance chart df = generate_sample_data() fig = go.Figure() fig.add_trace(go.Scatter( x=df['date'], y=df['portfolio_value'], mode='lines+markers', line=dict(color='#4CAF50', width=3), fill='tonexty', fillcolor='rgba(76, 175, 80, 0.1)', name='Portfolio Value' )) fig.update_layout( template='plotly_dark', height=400, showlegend=False, margin=dict(l=0, r=0, t=0, b=0), xaxis=dict(showgrid=False), yaxis=dict(showgrid=True, gridcolor='rgba(255,255,255,0.1)') ) st.plotly_chart(fig, use_container_width=True) with col2: st.markdown("### ๐ŸŽฏ Strategy Status") strategies = [ {"name": "Market Making", "status": "active", "pnl": "+$342"}, {"name": "Arbitrage", "status": "active", "pnl": "+$156"}, {"name": "Grid Trading", "status": "active", "pnl": "+$89"}, {"name": "DCA Bot", "status": "inactive", "pnl": "+$234"}, ] for strategy in strategies: status_class = "status-active" if strategy["status"] == "active" else "status-inactive" status_icon = "๐ŸŸข" if strategy["status"] == "active" else "๐Ÿ”ด" st.markdown(f"""
{strategy['name']}
{status_icon} {strategy['status'].title()}
{strategy['pnl']}
""", unsafe_allow_html=True) st.divider() # Feature Showcase st.markdown("## ๐Ÿš€ Platform Features") col1, col2, col3 = st.columns(3) with col1: st.markdown("""
๐ŸŽฏ

Strategy Development

""", unsafe_allow_html=True) with col2: st.markdown("""
๐Ÿ“Š

Analytics & Insights

""", unsafe_allow_html=True) with col3: st.markdown("""
โšก

Live Trading

""", unsafe_allow_html=True) st.divider() # Quick Actions st.markdown("## โšก Quick Actions") col1, col2, col3, col4 = st.columns(4) with col1: if st.button("๐Ÿš€ Deploy Strategy", use_container_width=True, type="primary"): st.switch_page("frontend/pages/orchestration/deploy_v2_with_controllers/app.py") with col2: if st.button("๐Ÿ“Š View Performance", use_container_width=True): st.switch_page("frontend/pages/performance/app.py") with col3: if st.button("๐Ÿ” Backtesting", use_container_width=True): st.switch_page("frontend/pages/backtesting/app.py") with col4: if st.button("๐Ÿ—ƒ๏ธ Archived Bots", use_container_width=True): st.switch_page("frontend/pages/orchestration/archived_bots/app.py") st.divider() # Community & Resources col1, col2 = st.columns([2, 1]) with col1: st.markdown("### ๐ŸŽฌ Learn & Explore") st.video("https://youtu.be/7eHiMPRBQLQ?si=PAvCq0D5QDZz1h1D") with col2: st.markdown("### ๐Ÿ’ฌ Join Our Community") st.markdown("""

๐ŸŒŸ Connect with Traders

Join thousands of algorithmic traders sharing strategies and insights!


๐Ÿ’ฌ Join Discord

๐Ÿ› Report Issues
""", unsafe_allow_html=True) # Footer stats st.markdown("---") col1, col2, col3, col4 = st.columns(4) with col1: st.metric("๐ŸŒ Global Users", "10,000+") with col2: st.metric("๐Ÿ’ฑ Exchanges", "20+") with col3: st.metric("๐Ÿ”„ Daily Volume", "$2.5M+") with col4: st.metric("โญ GitHub Stars", "7,800+")