A personal portfolio of Python and JavaScript packages for online time series prediction, covariance estimation, portfolio construction and black-box optimization, plus research notes.
QuantJourneyOrg/quantjourney-bt
A Python backtesting engine for reproducible portfolio research, modeling signals, orders, fills, costs, NAV and walk-forward validation.
- Stars
- 599
- Forks
- 245
- Open issues
- 0
- Last commit
- 3 days ago
Repolode describes open-source projects and does not give investment advice. Trading and investing can lose money: assess the risk yourself and follow the laws where you live before using this project.
What is it?
QuantJourney Backtester turns trading strategy ideas into auditable research runs. Signals become target weights or explicit orders, orders become simulated fills, fills update cash and positions, and NAV is rebuilt from portfolio state, so each assumption about execution, costs, slippage and rebalancing is visible rather than implicit.
It supports two modes: weight mode for portfolio research such as factor portfolios, rotation models, long/short books and volatility targeting, and order mode for execution-aware work with market, limit, stop, stop-limit, trailing, bracket and OCO orders. Each run can produce metrics, plots, equity curves, drawdowns, walk-forward results, CSV/JSON artifacts and a static HTML dashboard.
The repository includes 50 runnable example strategies and a deterministic sample dataset for trying the engine without an account. Real market data is fetched through QuantJourney Cloud, while strategy code and simulation stay local. Borrow fees, financing and market impact are simplified in some examples and documented as such.
Key features
- 01Weight mode and order mode for portfolio and execution-aware backtests
- 02Order types include market, limit, stop, trailing, bracket and OCO
- 03Configurable commissions, slippage and volume participation
- 04Walk-forward validation and Optuna-based parameter optimization
- 05Run outputs include metrics, plots, CSV/JSON files and an HTML dashboard
- 0650 runnable example strategies with a deterministic offline sample dataset
Use cases
- Testing a factor or rotation strategy with realistic costs and rebalancing rules
- Checking whether a strategy's edge survives out-of-sample walk-forward validation
- Prototyping limit, stop or bracket order logic before connecting to a broker
- Producing reproducible backtest reports for review by a research team
Quick start
- 1
Install the package from PyPI
pip install quantjourney-bt - 2
Check one strategy import without credentials
./strategy.sh example_weights_01_sma_daily --check - 3
Run a deterministic demo with bundled sample data
./strategy.sh example_weights_01_sma_daily --sample-data --output /tmp/qj-sample
Things to know
- Real market data requires a QuantJourney API key and account credentials.
- Requires Python 3.11 or newer.
- This is a backtesting engine, not a broker or live trading system.
- Some examples simplify assumptions such as borrow cost, financing, liquidity and market impact.
Topics
FAQ
- What is quantjourney-bt?
- A Python backtesting engine for reproducible portfolio research, modeling signals, orders, fills, costs, NAV and walk-forward validation. QuantJourney Backtester turns trading strategy ideas into auditable research runs. Signals become target weights or explicit orders, orders become simulated fills, fills update cash and positions, and NAV is rebuilt from portfolio state, so each assumption about execution, costs, slippage and rebalancing is visible rather than implicit.
- Is quantjourney-bt free to use? What license does it have?
- quantjourney-bt is open source under the Apache-2.0 license. Check the license terms before using it in commercial products.
- Is quantjourney-bt still maintained?
- Actively maintained. The last commit to quantjourney-bt was on Nov 4, 2026.
- What can I use quantjourney-bt for?
- Testing a factor or rotation strategy with realistic costs and rebalancing rules Checking whether a strategy's edge survives out-of-sample walk-forward validation Prototyping limit, stop or bracket order logic before connecting to a broker Producing reproducible backtest reports for review by a research team
- How do I install quantjourney-bt?
- Install the package from PyPI: pip install quantjourney-bt Check one strategy import without credentials: ./strategy.sh example_weights_01_sma_daily --check Run a deterministic demo with bundled sample data: ./strategy.sh example_weights_01_sma_daily --sample-data --output /tmp/qj-sample
- Where can I get quantjourney-bt?
- The source code and installation instructions are on GitHub: https://github.com/QuantJourneyOrg/quantjourney-bt
Summary generated by AI from the project's README. GitHub stats refresh daily.
Related projects
Python library for portfolio optimization, factor model construction and risk management, built on scikit-learn's API.
Pythonic event-driven backtesting library for trading strategies, a community-maintained fork of Quantopian's Zipline.
Python toolkit for trading research that backtests thousands of strategy ideas across assets and timeframes using vectorized NumPy and pandas operations.
A curated Awesome list of libraries, papers, strategies, books, blogs and courses for systematic (quantitative) trading.
Python toolkit from Goldman Sachs for quantitative finance, covering derivatives pricing, risk management and trading strategy development.