Streamlit-powered interactive visualization dashboard for backtest results.
- Total Return: Overall P&L percentage
- Sharpe Ratio: Risk-adjusted returns
- Maximum Drawdown: Worst peak-to-trough decline
- Win Rate: Percentage of profitable trades
- Volatility: Annualized return volatility
-
Equity Curve & Drawdown
- Interactive time-series plot
- Shows portfolio value over time
- Drawdown visualization
-
Execution Analytics
- Slippage distribution (basis points)
- Latency distribution (milliseconds)
- P99 latency tracking
-
Market Microstructure
- Volume imbalance (bid/ask ratio)
- Color-coded bar chart
- Helps identify market conditions
-
Trade Log
- Recent trades table
- Symbol, side, quantity, price
- Slippage and latency per trade
pip install -r requirements.txt# From project root
streamlit run src/dashboard/app.py
# Or with custom port
streamlit run src/dashboard/app.py --server.port 8502Open browser to http://localhost:8501
- Show Trade Markers: Display trade execution points
- Show Drawdown: Toggle drawdown subplot
- Real-time metrics in sidebar
- Delta indicators for quick assessment
The dashboard can load data from:
- Sample Data (default): Synthetic data generator
- JSON Files: Load from
src/dashboard/data/*.json - Database: Connect to PostgreSQL/MongoDB
- Live Backtest: Real-time updates
# In app.py
st.header("My Custom Chart")
fig = go.Figure()
fig.add_trace(go.Scatter(x=data['x'], y=data['y']))
st.plotly_chart(fig, use_container_width=True)# Modify color palette
COLOR_SCHEME = {
'primary': '#2E86AB',
'secondary': '#A23B72',
'accent': '#F18F01',
'success': '#06A77D'
}(Run the dashboard to see live interactive charts)
- Streamlit: Web framework
- Plotly: Interactive charts
- Pandas: Data manipulation
- NumPy: Numerical computations
This dashboard demonstrates:
- Full-stack capability: Backend (Python) + Frontend (Streamlit)
- Data visualization: Complex financial metrics
- UX design: Clean, professional interface
- Production-ready: Deployable to cloud (Streamlit Cloud, AWS, GCP)
# Free hosting
1. Push to GitHub
2. Connect to streamlit.io
3. Deploy from repoFROM python:3.10
WORKDIR /app
COPY requirements.txt .
RUN pip install -r requirements.txt
COPY . .
CMD ["streamlit", "run", "src/dashboard/app.py"]Same as parent project.