Asset class

Code Library

Trading strategies, research, and tutorials that you can clone into your deployment.

Equities Intro

equities eod ib moonshot sampledata sharadar

Introductory tutorial for equities demonstrating data collection, universe selection, and backtesting of an end-of-day momentum strategy using Moonshot. Data from Sharadar or Interactive Brokers. Compatibile with sample data.

quantrocket codeload clone 'equities-intro'

Pairs Trading

equities ib eod moonshot erniechan pairs usa global

Pairs trading strategy for Moonshot that includes a research pipeline for identifying and selecting pairs. Tests all possible pairs in a universe for cointegration using the Johansen test, then runs in-sample backtests on all cointegrating pairs, then runs an out-of-sample backtest on the 5 best performing pairs. Calculates daily hedge ratios using the Johansen test and times entries and exits using Bollinger Bands.

quantrocket codeload clone 'pairs-pipeline'


equities eod moonshot fundamentals sharadar alphaarchitect usa

Value strategy for US stocks modeled on Alpha Architect's QVAL ETF, using enterprise multiple and Piotroski F-Score to target cheap, high-quality stocks. Utilizes Sharadar fundamental and price data. Runs in Moonshot.

quantrocket codeload clone 'qval'

Forex Business Day

forex ib sampledata intraday moonshot livetrading academicpaper

Intraday forex strategy that exploits the tendency of currencies to depreciate during local business hours and appreciate during foreign business hours. Uses EUR.USD with hourly data from Interactive Brokers. Runs in Moonshot. Compatibile with sample data.

quantrocket codeload clone 'fx-bizday'

Machine Learning and the Kitchen Sink

equities eod ib usa moonshot fundamentals sharadar ml

Machine learning strategy that trains the model using 'everything and the kitchen sink': fundamentals, technical indicators, returns, price levels, volume and volatility spikes, liquidity, market breadth, and more. Runs in Moonshot. Utilizes data from Sharadar and IB.

quantrocket codeload clone 'kitchensink-ml'

Intraday Futures Calendar Spreads

futures intraday ib usa moonshot pairs livetrading

Intraday trading strategy for futures calendar spreads. Uses crude oil futures and 1-minute bid/ask bars from Interactive Brokers with a Bollinger Band mean reversion strategy. Runs in Moonshot. Demonstrates using exchange native spreads for live/paper trading, and non-native spreads for backtesting.

quantrocket codeload clone 'calspread'

QVAL Live Trading

equities eod moonshot fundamentals sharadar alphaarchitect usa livetrading

Live trading tutorial for QVAL value strategy for US stocks. Utilizes Sharadar fundamentals with IB price data.

quantrocket codeload clone 'qval-live'

QMOM US Momentum

equities eod moonshot alphaarchitect usa

Long-only momentum strategy modeled on Alpha Architect's QMOM ETF, selecting stocks with the smoothest momentum and rebalancing the portfolio before quarter end to capture a window-dressing seasonality effect.

quantrocket codeload clone 'qmom'

VMOT Value/Momentum/Trend

equities eod moonshot alphaarchitect usa

Value/Momentum/Trend strategy modeled on Alpha Architect's VMOT ETF. This repository provides the trend strategy and walks through backtesting the value, momentum, and trend strategies in tandem. For the value and momentum strategies, see the qval and qmom repositories.

quantrocket codeload clone 'vmot'

Leveraged ETF Intraday Momentum

equities ib intraday moonshot erniechan usa

Intraday momentum strategy that buys (sells) leveraged ETFs late in the trading session following a significant intraday gain (loss) and holds until the close. From Ernie Chan's book Algorithmic Trading. Uses 15-minute data from Interactive Brokers. Runs in Moonshot.

quantrocket codeload clone 'trend-day'

End-of-Day Global Equities Data

equities eod ib global

Data collection tutorial for end-of-day global equities data from IB. Covers 18 countries.

quantrocket codeload clone 'global-equities-eod-ib'

First Half Hour Predicts Last Half Hour

equities ib intraday moonshot academicpaper usa

Intraday momentum strategy that buys (sells) the S&P 500 when the first half hour return and penultimate half hour return are both positive (negative). Uses VIX filter to restrict strategy to high volatility regimes. Uses 30-minute data from Interactive Brokers. Runs in Moonshot.

quantrocket codeload clone 'first-last'

Global Market Profiles

equities ib global

Comparative analysis of stock market characteristics for 17 countries, including number of listings, short sale availability, volatility, distribution of sectors, etc.

quantrocket codeload clone 'global-market-profiles'

Moonshot Benchmarks


Equal-weighted and dollar-volume-weighted benchmark strategies for Moonshot.

quantrocket codeload clone 'benchmark'

High Minus Low

equities eod moonshot zipline fundamentals

HML (High Minus Low) strategy for Moonshot and Zipline, using Reuters Fundamentals. Code only, no notebooks.

quantrocket codeload clone 'hml'

Backtrader Moving Average


Dual moving average crossover strategy for backtrader

quantrocket codeload clone 'backtrader-dma'

Zipline Futures Pairs Trading

futures eod zipline usa

futures pairs trading Zipline strategy.

quantrocket codeload clone 'zipline-futures-pairs'