Skip to content

About

This repository contains two independent quantitative trading strategies developed as part of an applied machine learning and financial research project. The projects combine financial data, machine learning, and alternative data sources to generate actionable investment strategies.

Resources

Stars

2 stars

Watchers

0 watching

Forks

Latest commit

 

History

3 Commits

Folders and files

Repository files navigation

Algorithmic Trading Research Projects

This repository contains two independent quantitative trading strategies developed as part of an applied machine learning and financial research project. The projects combine financial data, machine learning, and alternative data sources to generate actionable investment strategies.

Projects Overview

  1. Unsupervised Learning & Portfolio Optimization
  2. Twitter Sentiment Investing Strategy

Each project demonstrates skills in data collection, preprocessing, quantitative analysis, modeling, and performance evaluation using Python.


1. Unsupervised Learning & Portfolio Optimization

Objective

Develop a data-driven trading strategy that selects high-potential S&P 500 stocks each month by clustering stocks based on financial and technical indicators, and constructing optimized portfolios that maximize risk-adjusted returns.

Methodology

  • Data Collection: 8 years of S&P 500 daily stock prices + Fama-French five-factor data.
  • Feature Engineering: Technical indicators (RSI, Bollinger Bands, ATR, MACD, Garman-Klass volatility), monthly returns, rolling factor betas.
  • Clustering & Portfolio Selection: K-Means clustering to group similar assets; selected high-momentum clusters.
  • Portfolio Construction: Efficient Frontier optimization to maximize Sharpe ratio with max 10% stock weight.

Results

Metric Strategy SP500 Benchmark
Cumulative Return 62% 56%
Annualized Return 7.5% 6.8%
Annualized Volatility 12% 13%
Sharpe Ratio 0.63 0.52

Insight: Portfolio optimization and unsupervised clustering enhanced risk-adjusted returns relative to the SP500.


2. Twitter Sentiment Investing Strategy

Objective

Leverage Twitter engagement metrics to identify high-sentiment stocks and generate a monthly rebalanced portfolio strategy.

Methodology

  • Data Collection: Twitter likes & comments per stock, filtered low-activity stocks.
  • Feature Engineering: Engagement ratio = comments / likes; aggregated monthly; ranked stocks cross-sectionally.
  • Portfolio Construction: Top 5 ranked stocks per month; equal-weight allocation; monthly rebalancing.
  • Performance Evaluation: Compared portfolio to NASDAQ (QQQ) returns.

Results

Metric Strategy NASDAQ (QQQ)
Cumulative Return 18% 12%
Annualized Return 8.5% 6.2%
Annualized Volatility 10% 11%
Sharpe Ratio 0.85 0.56

Insight: Social sentiment provided a measurable edge, improving risk-adjusted returns relative to the benchmark.


Technologies & Tools

  • Programming: Python (Pandas, NumPy, Scikit-learn, Statsmodels, PyPortfolioOpt, Matplotlib, yfinance, pandas_ta)
  • Machine Learning: K-Means clustering for asset selection
  • Portfolio Optimization: Efficient Frontier with Sharpe ratio maximization
  • Alternative Data Analysis: Social media sentiment integration

Usage

  1. Clone the repository:
git clone https://github.com/yourusername/algorithmic-trading-projects.git
cd algorithmic-trading-projects
  1. Install required packages:
pip install -r requirements.txt
  1. Run the notebooks:

    • Unsupervised_Portfolio_Optimization.ipynb
    • Twitter_Sentiment_Strategy.ipynb
  2. Modify parameters (e.g., clustering targets, stock universe, date range) to test different strategies.


Key Learnings

  • Alternative data (Twitter engagement) can provide actionable insights for equity selection.
  • Unsupervised learning effectively identifies high-potential assets using complex feature sets.
  • Portfolio optimization ensures enhanced risk-adjusted performance.
  • Combining financial and machine learning methods produces robust quantitative trading strategies.

Author

Daniels Shashkovs Data Science Student | Quantitative Research Enthusiast | Machine Learning Engineer Enthusiast.


About

This repository contains two independent quantitative trading strategies developed as part of an applied machine learning and financial research project. The projects combine financial data, machine learning, and alternative data sources to generate actionable investment strategies.

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages