Skip to content

Repository files navigation

AlphaPilot

Systematic strategy research and portfolio optimization engine.

AlphaPilot is a quantitative research platform designed for testing rule-based trading strategies, analyzing historical performance, and studying portfolio construction under classical mean–variance theory.

The system provides a structured workflow for financial data analysis, strategy simulation, and portfolio optimization using historical market datasets. Rather than focusing on single trading rules, the project emphasizes systematic experimentation, performance evaluation, and risk–return modeling.


Research Capabilities

AlphaPilot implements a basic pipeline for systematic strategy research:

  • financial time-series ingestion from CSV datasets
  • return and volatility estimation
  • rule-based trading signal generation
  • historical strategy backtesting
  • equity curve construction
  • portfolio allocation via mean–variance optimization
  • interactive visualization of strategy and portfolio behavior

The platform provides an exploratory environment for studying strategy performance and portfolio construction under simplified assumptions.


Strategy Simulation

The system supports basic rule-based trading strategies.

Moving Average Strategy

A simple trend-following rule based on the relationship between short-term and long-term moving averages.

Signals are generated as Buy → short MA crosses above long MA Sell → short MA crosses below long MA


RSI Momentum Strategy

Momentum signals are generated using the Relative Strength Index.

Typical thresholds: RSI < 30 → Buy signal RSI > 70 → Sell signal

These strategies serve as baseline examples for studying systematic trading rules.


Backtesting Framework

The backtesting module evaluates strategy performance using historical data.

Key outputs include:

  • daily return series
  • cumulative equity curve
  • strategy profit and loss
  • volatility estimation
  • basic performance statistics

The goal is not to claim profitable strategies but to provide a framework for analyzing strategy behavior under historical market conditions.


Portfolio Optimization

AlphaPilot implements classical mean–variance portfolio optimization following the Markowitz framework.

Given asset return estimates: maximize wᵀ μ subject to wᵀ Σ w ≤ σ² ∑ w = 1

where

  • μ represents expected returns
  • Σ represents the covariance matrix
  • w represents asset weights

The optimizer computes portfolio allocations that balance expected return and risk.


System Workflow

Typical analysis flow:

  1. Upload historical price dataset
  2. Compute daily returns
  3. Select trading strategy
  4. Generate buy/sell signals
  5. Run historical backtest
  6. Evaluate performance statistics
  7. Construct optimized portfolio allocation

Interface Overview

Landing Page

Landing Page

Data Analysis

Data Analysis

Strategy Selection

Strategy

Signal Preview

Signal Preview

Backtesting Engine

Backtest

Backtest Results

Backtest Results

Portfolio Optimization

Portfolio Optimization

Portfolio Performance

Portfolio Performance

Risk Metrics

Risk Metrics

PnL Distribution

PnL Distribution


Example Dataset Format

Input datasets should contain at least one price column. DATE,CLOSE 2024-01-01,3200.5 2024-01-02,3215.3 2024-01-03,3198.7

Additional columns such as OPEN, HIGH, LOW, and VOLUME may also be included.


Technology Stack

Core

  • Python
  • NumPy
  • Pandas

Interface

  • Streamlit
  • Plotly

Quantitative Methods

  • rule-based trading strategies
  • historical backtesting
  • mean–variance portfolio optimization

Local Setup

Clone repository git clone https://github.com/Aryan-core/AlphaPilot.git cd AlphaPilot

Install dependencies pip install -r requirements.txt

Run application streamlit run app.py


Live Demo

https://alphapilot.streamlit.app


Project Suite

AlphaPilot is part of a broader quantitative research toolkit:

  • QuantCore AI — financial data ingestion and research infrastructure
  • VaRGuard — Monte Carlo risk simulation and Value at Risk estimation
  • AlphaPilot — strategy testing and portfolio construction

Together these tools form a simple research pipeline: Data Processing → Risk Analysis → Strategy Research


Project Status

Current version focuses on:

  • systematic strategy experimentation
  • backtesting infrastructure
  • basic portfolio optimization

The system is intended as a research environment rather than a production trading system.


References

Markowitz, H.
Portfolio Selection
Journal of Finance, 1952.

Hull, J.
Options, Futures, and Other Derivatives.

Glasserman, P.
Monte Carlo Methods in Financial Engineering.


Author

Aryan Khan
Drexel University


License

MIT License

About

End-to-end quantitative trading lab for strategy backtesting, portfolio optimization and risk analysis using real market data.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages