Professional Algorithmic Trading Backtesting Platform
A full-stack web application for backtesting algorithmic trading strategies with interactive visualizations and comprehensive performance analytics. Built with React frontend and FastAPI backend.
π Live website: https://quantdash-playground.onrender.com PS! Website may take some time to boot up after inactivity as a result of using the free tier on Render.com
QuantDash provides a professional-grade platform for developing, testing, and analyzing algorithmic trading strategies. The platform features a modern web interface with real-time parameter adjustment, interactive charts, and detailed performance metrics.
- π 6 Pre-built Trading Strategies - Ready-to-use algorithms with customizable parameters
- π Interactive Visualizations - Real-time charts with Plotly integration
- π Comprehensive Analytics - Sharpe ratio, Sortino ratio, max drawdown, win rate, and more
- ποΈ Live Parameter Tuning - Adjust strategy parameters in real-time
- π± Mobile Responsive - Access from any device on your network
- π¨ Professional UI - Modern, clean interface with gradient designs
- π Real-time Data - Live stock data integration with caching
- π Ticker Autocomplete - Smart ticker search with validation
| Component | Technology | Purpose |
|---|---|---|
| Frontend | React + TypeScript + Vite | Modern web interface |
| Backend | FastAPI + Python | High-performance API server |
| Data Processing | Pandas + NumPy | Financial data manipulation |
| Data Source | yfinance | Real-time stock data |
| Visualization | Plotly.js | Interactive charts |
| Styling | Tailwind CSS | Modern responsive design |
| Caching | Parquet files | High-performance data storage |
QuantDash/
βββ backend/ # Python FastAPI backend
β βββ src/
β β βββ strategies/ # Trading strategy implementations
β β β βββ ma_crossover.py # Moving Average Crossover
β β β βββ bollinger_breakout.py # Bollinger Band Breakout
β β β βββ dual_momentum.py # Dual Momentum Strategy
β β β βββ gap_fade.py # Gap Fade Strategy
β β β βββ rsi_pullback.py # RSI Pullback Strategy
β β β βββ turtle_breakout.py # Turtle Breakout Strategy
β β βββ backtesting/ # Backtesting engine
β β β βββ engine.py # Main backtesting logic
β β β βββ viz.py # Visualization generation
β β βββ data/ # Data fetching and caching
β β β βββ data_fetcher.py # yfinance integration
β β βββ api/ # FastAPI server
β β β βββ server.py # API endpoints
β β βββ utils/ # Helper utilities
β βββ cache/ # Cached market data (Parquet)
β βββ main.py # Backend entry point
βββ frontend/ # React frontend
β βββ src/
β β βββ pages/ # React pages
β β β βββ Index.tsx # Main trading interface
β β βββ services/ # API integration
β β β βββ api.ts # Backend communication
β β βββ components/ # Reusable components
β βββ public/
β β βββ logo.png # QuantDash logo
β βββ package.json # NPM dependencies
β βββ vite.config.ts # Vite configuration
βββ config/
β βββ config.yaml # Application configuration
βββ docs/ # Documentation
βββ requirements.txt # Python dependencies
βββ README.md # This file
- Python 3.9+ with conda/pip
- Node.js 18+ with npm
- Git
git clone https://github.com/jakobildstad/QuantDash.git
cd QuantDash# Navigate to backend
cd backend
# Create conda environment (recommended)
conda create -n quant python=3.9
conda activate quant
# Install dependencies
pip install -r ../requirements.txt
# Start backend server
python src/api/server.pyThe backend will start on http://localhost:8000
# Navigate to frontend (new terminal)
cd frontend
# Install dependencies
npm install
# Start development server
npm run devThe frontend will start on http://localhost:5173
- Live Demo: https://quantdash-frontend.onrender.com (Production deployment)
- Local: http://localhost:5173
- Network: http://YOUR_IP:5173 (for mobile access)
Strategy: Buy when fast MA crosses above slow MA, sell when below
- Parameters: Fast Period (5-50), Slow Period (10-100)
- Use Case: Trend following in trending markets
Strategy: Trade breakouts above/below Bollinger Bands
- Parameters: Period (10-50), Standard Deviation (1.0-3.0)
- Use Case: Volatility breakouts and momentum trading
Strategy: Combine absolute and relative momentum signals
- Parameters: Lookback Period (20-120), Risk-Free Rate (0-10%)
- Use Case: Long-term trend following with risk management
Strategy: Fade significant overnight gaps expecting mean reversion
- Parameters: Gap Threshold (1-5%), Stop Loss (2-10%)
- Use Case: Intraday mean reversion trading
Strategy: Buy oversold pullbacks in uptrends, sell overbought in downtrends
- Parameters: RSI Period (7-30), MA Period (20-100), Oversold/Overbought levels
- Use Case: Counter-trend trading with trend filter
Strategy: Trade channel breakouts with ATR-based position sizing
- Parameters: Entry Period (10-50), Exit Period (5-30), ATR Period (10-30), Risk %
- Use Case: Systematic breakout trading with risk management
QuantDash calculates comprehensive performance analytics:
| Metric | Description | Interpretation |
|---|---|---|
| Total Return | Overall percentage gain/loss | Higher is better |
| Sharpe Ratio | Risk-adjusted return | > 1.0 is good, > 2.0 is excellent |
| Sortino Ratio | Downside risk-adjusted return | Focuses on harmful volatility |
| Max Drawdown | Largest peak-to-trough decline | Lower is better (< -20% concerning) |
| Volatility | Annual price volatility | Strategy-dependent preference |
| Win Rate | Percentage of profitable trades | > 50% preferred for most strategies |
| Total Trades | Number of completed trades | Higher provides better statistics |
Frontend (.env.local):
# API endpoint
VITE_API_BASE_URL=http://localhost:8000/apiBackend Configuration (config/config.yaml):
data:
cache_dir: "cache"
default_period: "1y"
strategies:
default_initial_cash: 10000
api:
cors_origins:
- "http://localhost:5173"
- "http://10.0.0.116:5173"Add new strategies by:
- Create strategy class in
backend/src/strategies/ - Inherit from BaseStrategy
- Implement required methods:
generate_signals(data)get_json_visualizations()
- Register in server.py
Example:
class CustomStrategy(BaseStrategy):
def __init__(self, param1=10, initial_cash=10000):
super().__init__("Custom Strategy", initial_cash)
self.param1 = param1
def generate_signals(self, data):
# Your strategy logic here
pass- Find your IP:
ipconfig getifaddr en0(macOS) oripconfig(Windows) - Update environment: Set
VITE_API_BASE_URL=http://YOUR_IP:8000/api - Restart servers
- Access from mobile:
http://YOUR_IP:5173
Live Application: https://quantdash-frontend.onrender.com
- Create Web Service on Render
- Connect GitHub repository
- Set build command:
pip install -r requirements.txt - Set start command:
cd backend && python src/api/server.py - Add environment variables as needed
- Create Static Site on Render
- Set build command:
cd frontend && npm install && npm run build - Set publish directory:
frontend/dist - Add environment variable:
VITE_API_BASE_URL=https://your-backend.onrender.com/api
# Backend Dockerfile
FROM python:3.9-slim
WORKDIR /app
COPY requirements.txt .
RUN pip install -r requirements.txt
COPY backend/ .
CMD ["python", "src/api/server.py"]cd backend
python -m pytest tests/ -vcd frontend
npm test- All 6 strategies load without errors
- Parameter changes update visualizations
- Charts display correctly
- Performance metrics calculate properly
- Mobile access works on network
- Ticker autocomplete functions
- Error handling works
Returns list of available stock tickers
{
"success": true,
"tickers": ["AAPL", "GOOGL", "MSFT", ...]
}Returns available strategies and parameters
{
"success": true,
"strategies": {
"moving_average_crossover": {
"name": "Moving Average Crossover",
"parameters": {...}
}
}
}Run backtest with parameters
{
"symbol": "AAPL",
"period": "1y",
"algorithm": "moving_average_crossover",
"initial_cash": 10000,
"algorithm_specific_params": {
"fast_period": 12,
"slow_period": 26
}
}"Load failed" error:
- Check backend server is running on port 8000
- Verify CORS settings allow your frontend URL
- Confirm environment variables are set correctly
Charts not displaying:
- Check browser console for JavaScript errors
- Verify Plotly.js is loaded correctly
- Ensure visualization data is valid JSON
Mobile access not working:
- Confirm both devices on same WiFi
- Update API URL to use IP address instead of localhost
- Check firewall/router settings
Strategy errors:
- Verify all required Python packages installed
- Check data availability for selected ticker
- Validate strategy parameters are in valid ranges
Enable detailed logging:
# Backend
export PYTHONPATH=$PYTHONPATH:./backend/src
python -m pdb backend/src/api/server.py
# Frontend
npm run dev -- --debug- Fork the repository
- Create feature branch (
git checkout -b feature/amazing-feature) - Commit changes (
git commit -m 'Add amazing feature') - Push to branch (
git push origin feature/amazing-feature) - Open Pull Request
- Follow PEP 8 for Python code
- Use TypeScript for frontend development
- Add tests for new features
- Update documentation
- Ensure mobile compatibility
This project is licensed under the MIT License - see the LICENSE file for details.
- yfinance for financial data
- Plotly for interactive visualizations
- FastAPI for high-performance backend
- React for modern frontend framework
- Tailwind CSS for beautiful styling
- Issues: GitHub Issues
- Discussions: GitHub Discussions
- Email: Contact through GitHub profile
Built with β€οΈ for algorithmic traders and quantitative analysts
