algorithmic-trading-engine

# โšก Algorithmic Trading Engine ### Quantitative Strategy Backtester ยท 3D Interactive Analytics ยท ML-Ready ![Python](https://img.shields.io/badge/Python-3.10+-3776ab?logo=python&logoColor=white) ![Streamlit](https://img.shields.io/badge/Streamlit-Live%20App-ff4b4b?logo=streamlit&logoColor=white) ![Plotly](https://img.shields.io/badge/Plotly-3D%20Interactive-3d3d3d?logo=plotly&logoColor=white) ![scikit-learn](https://img.shields.io/badge/scikit--learn-ML%20Models-f7931e?logo=scikit-learn&logoColor=white) ![XGBoost](https://img.shields.io/badge/XGBoost-Gradient%20Boosting-189fdd)
[๐Ÿš€ **Launch Live Engine**](https://algorithmic-trading-engine-falgun-gadhiya.streamlit.app/)   |   [๐Ÿ“Š **Interactive 3D Charts**](https://gadhiyafalgun-arch.github.io/algorithmic-trading-engine/)   |   [๐Ÿ’ป **Source Code**](https://github.com/gadhiyafalgun-arch/algorithmic-trading-engine)

๐Ÿ“ธ Preview

Trading Engine Dashboard

๐Ÿ‘† Click the image to launch the live engine


๐Ÿง  What It Does

A full end-to-end algorithmic trading engine that runs a complete pipeline on 8 stocks (AAPL, GOOGL, MSFT, AMZN, TSLA, SPY & more) from 2020โ€“2024:

Phase Description
๐Ÿ“ฅ Data Pipeline Fetches and cleans daily OHLCV data via yfinance
๐Ÿ“ Indicators SMA, EMA, RSI, MACD, Bollinger Bands, ATR, Stochastic, VWAP
๐ŸŽฏ Strategies SMA Crossover, RSI, MACD, Bollinger Bands, Combined Multi-Signal
๐Ÿ“ˆ Backtesting Realistic simulation โ€” 0.1% commission, 0.05% slippage, stop-loss/take-profit
โš–๏ธ Risk Management VaR, Sharpe/Sortino/Calmar ratios, max drawdown, position sizing
๐Ÿค– Machine Learning XGBoost + Random Forest with 100+ features, walk-forward validation
๐Ÿ“Š Visualization 13 interactive 3D Plotly charts + Streamlit dashboard

๐ŸŽฎ Live Engine Features

๐Ÿš€ Launch the Live Engine โ†’

Feature What You Can Do
๐Ÿ”€ Stock Selector Switch between multiple listed stocks
๐Ÿ“… Date Range Customize backtest period (2020โ€“2024)
๐ŸŽฏ Strategy Picker Choose from 5 strategies including Combined Multi-Signal
๐Ÿ’ฐ Capital & Costs Adjust initial capital, commission, and slippage
โšก Risk Slider Drag to see Low โ†’ Medium โ†’ High risk impact in real time
๐Ÿ“Š Performance Grade Auto-graded performance summary with key metrics

๐Ÿ“Š Interactive 3D Charts

๐ŸŒ View Static 3D Charts โ†’

Drag the โšก Risk Level slider to explore:

Chart Description
๐Ÿ“Š Risk Bar (3D) Portfolio backtest with interactive risk slider
๐Ÿ“ˆ Equity Comparison Side-by-side strategy equity curves
๐Ÿค– ML Signal Machine learning buy/sell signals
๐Ÿ“‰ MACD MACD momentum analysis
๐Ÿ’ผ Portfolio Backtest Multi-stock portfolio results

๐Ÿš€ Run Locally

```bash

Clone the repo

git clone https://github.com/gadhiyafalgun-arch/algorithmic-trading-engine.git cd algorithmic-trading-engine

Install dependencies

pip install -r requirements.txt

Run the full pipeline (generates charts)

python main.py

Or launch the Streamlit app locally

streamlit run app.py