Quantitative Research · Open Source Code

Trading
Ideas

A collection of quantitative trading strategies, statistical arbitrage frameworks, and backtesting tools developed across years of research in systematic finance. All code open-source on GitHub.

Python Statistical Arbitrage Pairs Trading Machine Learning HMM Regime Detection Cointegration Backtesting Cryptocurrency

Open Source

GitHub
Repositories

📈 davidovg / Trading-Ideas
FEATURED REPOSITORY
Python
The primary quantitative trading repository. Implements and backtests different systematic trading ideas — from statistical arbitrage and mean-reversion strategies to momentum and factor-based approaches. All strategies developed with rigorous academic methodology.
View on GitHub →
📊 davidovg / Quantitative-Finance
Python
Broader quantitative finance projects covering portfolio construction, risk analytics, and financial modelling. Complements the trading strategies with the underlying mathematical and statistical infrastructure.
View on GitHub →
⚡ davidovg / Risk-Tools
Python
Risk management toolset built from years of professional experience across Erste Group, GFG Monaco, and Commerzbank. Covers VaR, CVaR, drawdown analytics, and portfolio stress testing utilities.
View on GitHub →

Live Track Record

Verified
Performance

A public, fully transparent investment portfolio on eToro — diversified across ETFs, equities, and FX, with disciplined risk management. All figures independently tracked and verifiable on the platform.

+51.9%
2-Year Return
+31.9%
2025 Return
66.7%
Profitable Weeks
4 / 10
Avg Risk Score
View Live Portfolio on eToro →
Figures as of mid-2026. Past performance is not an indicator of future results. Not investment advice.

Core Strategies

Quantitative
Approaches

01
Statistical Pairs Trading
Mean Reversion · Cointegration
Exploits stationary spreads between cointegrated asset pairs. Entry when spread deviates beyond threshold, exit at mean-reversion. Applied to volatility ETFs, crypto, and equity pairs. Tested with ADF, KPSS, and Engle-Granger cointegration tests.
02
Hierarchical ML Pair Trading
CatBoost · HMM · Regime Detection
Two-layer architecture: bottom model (CatBoost) predicts future spread and generates signals; top model (HMM) filters signals by detecting market regime. Significantly reduces false signals during regime shifts and trending periods. Applied to cryptocurrency market.
03
Regime-Based Allocation
HMM · Multi-Asset · Dynamic
Hidden Markov Models identify latent market regimes (bull/bear/crisis). Portfolio allocations shift dynamically based on detected regime. Reduces drawdown in crisis periods while maintaining upside exposure in trending regimes.
04
Factor Momentum Strategy
Factor Investing · Multi-Asset · Systematic
Cross-sectional momentum applied to factor returns rather than individual assets. Long outperforming factors, short underperforming. Diversifies across Value, Momentum, Quality, and Low Volatility factors with systematic rebalancing.

Sample Code

Cointegration
Framework

Core logic from the pairs trading strategy — testing for cointegration, fitting the spread, and generating entry/exit signals.

# Pairs Trading Core Framework — Boyan Davidov
# Statistical arbitrage via cointegration

import numpy as np
import pandas as pd
from statsmodels.tsa.stattools import coint, adfuller
from statsmodels.regression.linear_model import OLS

def test_cointegration(s1, s2, significance=0.05):
    """Test pair for cointegration using Engle-Granger."""
    score, pvalue, _ = coint(s1, s2)
    return pvalue < significance, pvalue

def compute_spread(s1, s2):
    """OLS regression to compute hedge ratio and spread."""
    model = OLS(s1, s2).fit()
    hedge_ratio = model.params[0]
    spread = s1 - hedge_ratio * s2
    return spread, hedge_ratio

def generate_signals(spread, entry_z=2.0, exit_z=0.5):
    """Z-score based entry/exit signal generation."""
    zscore = (spread - spread.mean()) / spread.std()
    signals = pd.Series(0, index=spread.index)
    signals[zscore >  entry_z] = -1   # Short spread
    signals[zscore < -entry_z] =  1   # Long spread
    signals[abs(zscore) < exit_z] =  0   # Exit
    return signals, zscore

def adf_stationarity(spread):
    """Verify spread stationarity via ADF test."""
    result = adfuller(spread.dropna())
    return {
        'statistic': result[0],
        'p_value':   result[1],
        'stationary': result[1] < 0.05
    }
DISCLAIMER: All code and research published here is for educational and informational purposes only. Nothing on this page constitutes investment advice or a recommendation to buy or sell any financial instrument. Past performance of any strategy shown does not guarantee future results. The author holds CFA, FRM, CAIA designations — not a licensed investment advisor under BaFin or any other regulatory body in relation to this content.

Academic Work

Research
Papers

2025
Hierarchical Two-Layer Pair Trading Strategy Using Machine Learning
Boyan Davidov · Pavel Biriukov · Christson Hartono
Proposes a novel hierarchical ML approach to pair trading in the cryptocurrency market. A bottom-layer CatBoost model predicts spread movements and generates signals; a top-layer Hidden Markov Model filters signals via dynamic regime detection. Addresses the problem of regime-induced false signals in mean-reversion strategies.
Machine Learning HMM CatBoost Cryptocurrency Statistical Arbitrage
2023
Classifying Physical Activities through Heart Rate Variability Using Holter Monitor Data
Boyan Davidov · Simona Mircheva · Boyan Markov
Published in Vanguard Scientific Instruments in Management (vol. 19, no. 1, 2023). Applies t-SNE, UMAP dimensionality reduction and ensemble classification to Holter monitor data for human activity recognition. Demonstrates efficacy of ML in health informatics with high precision and F1-scores.
Published VSIM Journal Machine Learning Health Informatics UMAP
2021
Long/Short Trading Strategy Design & Backtesting
Boyan Davidov, CFA, CAIA, FRM — CQF Final Project
CQF programme final project. Implements a cointegration-based pairs trading strategy on volatility ETF/ETN instruments. Covers statistical foundations (autocorrelation, mean-reversion, stationarity), cointegration testing, signal generation, and rigorous backtesting with performance evaluation and a discussion of arbitrage caveats.
CQF Cointegration Backtesting Volatility ETF Statistical Arbitrage
Full publication list on ResearchGate →