MCP Backtesting Dashboard
sahil-bt-dash.streamlit.app
A modular dashboard for equity strategy backtesting, integrating market data, news sentiment analysis, and strategy performance insights using a multi-adapter architecture.
##
Strategy Visualization
Interactive charts with several technical indicators.
Strategy Insights & Analysis
Comprehensive performance analysis with intelligent insights and visualizations.
Features
- Multi-source data integration (market prices via yfinance, news scraping)
- Sentiment analysis integration
- Backtesting engine with Backtrader
- Pre-built trading strategies
- Strategy performance insights
- Interactive Streamlit dashboard
Setup
Prerequisites
- Python 3.8 or higher
- pip (Python package manager)
On WSL/Ubuntu, install python3-venv if needed:
sudo apt install -y python3.12-venv python3-pipInstallation
# Create virtual environment
python3 -m venv venv
# Activate virtual environment
source venv/bin/activate
# Install dependencies
pip install -r requirements.txtConfiguration
Create a .env file for OpenAI API integration:
cp .env.example .envEdit .env and add your OpenAI API key:
OPENAI_API_KEY=your_actual_api_key_hereUsage
Activate the virtual environment:
source venv/bin/activateRun the Streamlit dashboard:
streamlit run app.pyProject Structure
├── app.py # Main Streamlit application entry point
├── requirements.txt # Python dependencies
├── .env.example # Environment variables template
│
├── adapters/ # Data source adapters
│ ├── yfinance_adapter.py
│ ├── news_adapter.py
│ └── sentiment_adapter.py
│
├── strategies/ # Trading strategies
│ └── prebuilt.py
│
├── backtest/ # Backtesting engine
│ └── engine.py
│
├── llm/ # LLM integration
│ └── openai_client.py
│
├── utils/ # Utility modules
│ ├── data_fetchers.py # Data fetching orchestration
│ └── ui_components.py # UI rendering components
│
├── config/ # Configuration files
│ └── static_flows.py # Pre-configured demo scenarios
│
├── tests/ # Test files
│ ├── test_adapters.py
│ ├── test_engine.py
│ ├── test_openai.py
│ └── ...
│
└── images/ # Screenshots and assets
├── BacktestDash-Home.png
├── BacktestDash-Bollinger.png
└── BacktestDash-StrategyInsights.pngDependencies
- Market data: yfinance
- Backtesting: Backtrader
- News scraping: BeautifulSoup, requests
