quant-trading: A Python Collection of Backtested Quantitative Trading Strategies
Python quantitative trading strategies including VIX Calculator, Pattern Recognition, Commodity Trading Advisor, Monte Carlo, Options Straddle, Shooting Star, London Breakout, Heikin-Ashi, Pair Trading, RSI, Bollinger Bands, Parabolic SAR, Dual Thrust, Awesome, MACD
At a glance
- What is it?
- quant-trading is a Python repository of standalone backtesting scripts covering technical indicators, statistical arbitrage, options strategies, and quantamental analysis projects. Each script simulates historical trades under frictionless assumptions and includes a main() function for embedding into a trading system.
- Who is it for?
- quant-trading is useful as a reference collection for engineers learning quantitative trading strategy implementation in Python. The frictionless assumptions mean no strategy in this repository translates directly to a live trading system without adding transaction cost modeling, slippage, and risk management layers.
- Can I use it commercially?
- Yes. Apache-2.0 is a permissive licence: you can use, modify and sell software built on it, as long as you keep its copyright and licence notices.
- Is it still maintained?
- Yes. The repository last received commits 102 days ago.
- What is it written in?
- Mainly Python, according to GitHub's language statistics.
Answers come from the project's GitHub data, last synced on September 29, 2026, and from our analysis. They are not legal advice.
Editorial analysis
What This Repository Contains and Who It Is For
quant-trading is a collection of Python scripts that implement and backtest quantitative trading strategies. The README organizes the strategies into three categories: technical indicators, quantamental analysis projects, and options strategies.
The intended audience is quantitative analysts and engineers who want to study trading strategy implementations in Python, understand the mechanics of specific indicators, or use a working script as a starting point for their own research. The README quotes Robert Mercer and Elwyn Berlekamp at the top, framing the repository around the idea that small, consistent edges compound over many trades.
The repository does not provide a live trading system and makes no claim to have generated profits. All scripts are historical data backtesting or forward testing. The README states explicitly that the assumption is all trades are frictionless with no slippage, no surcharge, and no illiquidity. This is a standard simplification for strategy research that makes the scripts unsuitable for direct deployment.
Technical Indicator Strategies
The largest category is technical indicators. Each strategy is a single Python file at the repository root. The strategies in this category are:
- MACD Oscillator: compares short-term and long-term moving averages on closing price. When the short-term average crosses above the long-term average, the strategy goes long. The README describes this as the most common strategy among non-professionals. - Parabolic SAR: a trend-following indicator that produces entry and exit signals based on a parabolic curve. - Heikin-Ashi Candlestick: uses averaged OHLC values to smooth price action and reduce noise in trend identification. - London Breakout: an opening range breakout strategy timed to the London market open. - Dual Thrust: a range breakout strategy that calculates a threshold based on high and low ranges. - Awesome Oscillator: uses the difference between 5-period and 34-period simple moving averages of the midpoint price. - Bollinger Bands Pattern Recognition: identifies price patterns in relation to Bollinger Bands. - RSI Pattern Recognition: combines the relative strength index with candlestick pattern detection. - Shooting Star: identifies the shooting star candlestick reversal pattern.
Quantamental Analysis Projects
Beyond simple technical indicators, the repository contains several larger quantamental projects that combine quantitative methods with fundamental or alternative data analysis:
- Pair Trading: statistical arbitrage based on cointegration. The README describes cointegration metaphorically as "a couple in a clingy relationship where two parties are crazy-glued together." The strategy uses Engle-Granger two-step analysis to identify cointegrated stock pairs, standardizes the residual, and generates long/short signals when the residual exceeds one standard deviation. - Monte Carlo Project: simulates portfolio outcomes using Monte Carlo methods. - Oil Money Project: analyzes the relationship between oil prices and currency movements. - Portfolio Optimization Project: optimizes portfolio weights across multiple assets. - Smart Farmers Project: uses agricultural data or alternative datasets for trading signals. - Wisdom of Crowd Project: applies collective sentiment or alternative data to generate signals.
Each project has its own subdirectory in the repository. The pair trading script in particular demonstrates a more complete research workflow: selecting pairs, running cointegration tests, standardizing residuals, and backtesting the resulting signals.
Options Strategies
The repository includes two options-related scripts. The Options Straddle backtest simulates the straddle strategy, which involves buying both a call and a put option at the same strike price to profit from large price movements in either direction.
The VIX Calculator script implements a volatility index calculation. The VIX, originally developed by the CBOE, is a measure of implied volatility derived from options prices. The script calculates a version of this index from the available data.
Both scripts follow the same pattern as the other scripts in the collection: they are standalone Python files that run historical simulations under frictionless assumptions and include a main() function.
Data Sources and Dependencies
The repository uses several data sources for historical market data. The README lists Bloomberg/Eikon, CME/LME exchange data, Histdata, FX Historical Data, Macrotrends, Stooq, and Quandl as sources. For accessible free sources, Yahoo Finance is used through the yfinance Python package. Reddit WallStreetBets data is scraped through a companion web scraping repository.
The repository does not include a requirements.txt or setup file. Each script's dependencies are implied by its imports. Common dependencies across the collection include pandas and matplotlib, plus whatever data access library the script uses (yfinance, a scraping script, or a CSV file from one of the listed sources).
Data source compatibility is a practical concern. Quandl has changed its access policies over the years, and some Macrotrends or Yahoo Finance endpoints may have changed behavior since the scripts were last tested. The last push to the repository was on 2026-06-20.
Limitations: No Framework, Frictionless Assumptions, Python-Only
The most significant limitation is the frictionless assumption. No real trading strategy operates without transaction costs, and the slippage on liquid instruments can represent a significant portion of the theoretical edge on short-timeframe strategies. A strategy that looks profitable in backtest under zero-cost assumptions may be unprofitable after accounting for bid-ask spread, commissions, and market impact.
The repository does not use a standard backtesting framework such as Backtrader or VectorBT. Each script implements its own backtesting loop. This means there is no standardized way to compare performance across scripts, and the risk of look-ahead bias (accidentally using future information in a historical simulation) depends entirely on the implementation of each individual script.
The README notes that there is no HFT strategy in the collection because ultra-high-frequency data is expensive. This limits the repository to strategies that operate on daily or lower-frequency data.
All scripts are in Python, not C++. The README acknowledges this as a tradeoff. For educational and research purposes, Python is adequate. For production execution at low latency, Python is not the right choice.
quant-trading vs. a Dedicated Backtesting Framework
Backtrader is a widely used Python backtesting framework that provides a structured environment for implementing, testing, and comparing trading strategies. It handles the backtesting loop, position tracking, and performance reporting, and it has a plugin ecosystem for data feeds and execution brokers.
The difference from je-suis-tm/quant-trading is architectural. Backtrader provides a common interface that all strategies implement, making it easier to run parameter sweeps and compare multiple strategies using the same performance metrics. The scripts in this repository are self-contained: each implements its own data loading, signal generation, and backtesting logic independently.
For an engineer learning a specific strategy's mechanics, the standalone script approach in this repository is readable and direct. For an engineer who wants to build a portfolio of strategies and compare them rigorously, a framework like Backtrader provides more infrastructure. The two approaches address different needs.
Editorial conclusion
quant-trading is useful as a reference collection for engineers learning quantitative trading strategy implementation in Python. The frictionless assumptions mean no strategy in this repository translates directly to a live trading system without adding transaction cost modeling, slippage, and risk management layers. The scripts use historical data from sources like Yahoo Finance and Stooq; any data source that has since changed its API or access policy will require updating. The last push was on 2026-06-20. For teams that need a framework for extending and testing strategies systematically, a dedicated backtesting library would be a better foundation than this collection of individual files.
Frequently asked questions
What Python libraries does the quant-trading repository use?
The README lists Yahoo Finance (via the yfinance package) as a data source. Other dependencies vary by script and are implied by each file's imports. Common dependencies in Python quant research include pandas and matplotlib. The repository does not include a requirements.txt file.
Can the trading strategies in this repository be used for live trading?
No. The README states explicitly that all scripts are historical data backtesting under frictionless assumptions with no slippage, no surcharge, and no illiquidity. The main() function in each script is designed for embedding, but adding live trading capability requires building data feed, order routing, and risk management components not present in this repository.
Does the quant-trading repository include a backtesting framework?
No. Each strategy is a standalone Python script that implements its own backtesting loop. There is no shared framework across scripts. If you need a standardized framework for comparing multiple strategies, Backtrader is a widely used Python alternative.
Official sources
Add this badge to your README
If you maintain this project, the badge below links readers to this analysis and shows its maintenance status from the daily GitHub snapshot. Paste the markdown into your README; add ?metric=license or ?metric=stars to the image URL for a different field.
[](https://hysenlabs.com/projects/je-suis-tm-quant-trading)