Quick answer
QSTrader is an open-source Python backtesting framework from QuantStart for systematic, portfolio-level strategies on equities and ETFs. Instead of reacting to every bar, it rebalances on a schedule using alpha models and risk models, then produces tear sheets. It suits allocation and rotation strategies rather than intraday trading.
QSTrader at a glance
- Category
- Backtest + live trading engines
- Language
- Python
- License
- MIT
- Does
- Backtesting, Performance analytics
- Markets
- Stocks, ETFs
- Best for
- Monthly or weekly ETF rotation, risk parity and other allocation strategies.
- In AlgoGP
- Use the exported strategy object from your own code
Pick it if
Monthly or weekly ETF rotation, risk parity and other allocation strategies.
Watch out for
Low recent activity.
QSTrader strengths and limitations
Strengths
- Portfolio-construction mindset with alpha and risk models.
- Clean, readable codebase from a well-known education site.
Limitations
- Low recent activity.
- No live trading; daily data only.
QSTrader example
pip install qstraderfrom qstrader.alpha_model.fixed_signals import FixedSignalsAlphaModel
alpha = FixedSignalsAlphaModel({"EQ:SPY": 0.6, "EQ:AGG": 0.4})
# pass alpha to BacktestTradingSession(..., rebalance="end_of_month") and run()Use QSTrader with AlgoGP
AlgoGP does not add QSTrader to projects automatically yet, but nothing stops you using them together. Every AlgoGP project exports plain Python with a framework-neutral strategy object, so you can call it from QSTrader yourself.
- 1
Design and backtest in AlgoGP
Describe the idea to the copilot and backtest it on AlgoGP’s normalized history.
- 2
Add any bridge to get the adapter core
Adding a bridged framework (for example Backtrader) writes
frameworks/algogp_bridge.py, whoseStrategyBridge.on_bar()returns the orders the strategy wants. - 3
Call it from QSTrader
Feed QSTrader’s bars to
StrategyBridge, place the returned orders with QSTrader, and report fills back withsync().
QSTrader: frequently asked questions
Can QSTrader trade live?
No, it is a backtesting framework.
QSTrader alternatives
- btPythonFlexible Python framework for portfolio-level backtests built from composable algos: select, weigh and rebalance on a schedule.
- Zipline ReloadedPythonThe maintained fork of Quantopian’s Zipline: an event-driven, pipeline-based backtester for US equities with data bundles and realistic slippage models.
- PyPortfolioOptPythonPortfolio optimization in Python: mean-variance, Black-Litterman, hierarchical risk parity, efficient frontiers and discrete allocation.
- BacktraderPythonThe classic Python event-driven backtesting library: Cerebro, data feeds, analyzers, sizers and plotting, with live stores for IB and OANDA.
Independent guide. AlgoGP is not affiliated with QSTrader. Features, licenses and maintenance change; check the official documentation. Nothing here is investment advice.