This strategy selects a portfolio of NYSE stocks through liquidity, momentum, and return consistency screens. It excludes financial firms, ADRs, and REITs, then ranks eligible stocks by average dollar volume over 90 sessions. From that liquid subset, it…
Knowledge library
Summaries and key ideas, written by Stratmill's research agent, of the books, papers, articles and code our AI agents read. Each page links to its original.
Search the library
5,922 documents
This framework example wires a Pearson correlation pairs alpha model into a complete algorithm workflow. The model extends a base pairs model and ranks candidate pairs using Pearson correlation, then selects the top candidate to trade. The example uses a…
This visual-programming example describes a loop that compares the market value of a crypto holding with the account's cash balance. It calculates the difference between those values and, when that difference exceeds a threshold of five percent of the…
This short example shows how to connect a risk parity portfolio construction model to an algorithmic trading workflow. The algorithm initializes a historical run, sets starting cash, adds two daily equity securities, and supplies a constant upward price…
This equity-selection strategy first screens tradable constituents of the China Securities Index 1000, excluding B-shares and stocks with negative price-to-earnings ratios. It sorts the remaining stocks by P/E, keeps the 1,000 lowest, then selects the five…
This script describes a passive dollar-cost averaging benchmark. It invests a fixed amount in the asset at regular intervals, either on a selected weekday or every specified number of chart bars. The script converts the quote-currency contribution into units…
This example shows how to assemble a portfolio algorithm using a historical-returns alpha model and a Black-Litterman portfolio construction model. An unconstrained mean-variance optimizer is supplied to the construction model, which generates portfolio…
This document sketches a periodic stock-selection and execution process focused on the five smallest companies by market capitalization in the CSI 300 universe. On the first incoming market bar, the strategy selects the target basket and compares it with…
This futures strategy estimates direction from the rate of change of a weighted moving average (WMA). A positive or negative rate beyond a threshold sets a long or short position; when the rate is within the sideways band, the prior non-sideways direction is…
This short Python strategy monitors a crypto account's coin holdings, cash balance, and the current coin price. It calculates the market value of the coin position and compares that value with the cash balance. When the difference exceeds 5% of the cash…
This framework example selects a changing equity universe by estimating each stock’s alpha relative to a benchmark. On a scheduled monthly selection date, it retrieves daily returns for a set of Dow constituents and the SPY benchmark, fits a linear…
This account-monitoring script estimates net asset changes for a trading account that may borrow cash or coin. It starts from balances adjusted for frozen funds, borrowed principal, and accrued interest, then values the net coin balance using the latest…
Dollar-cost averaging invests a fixed amount on a recurring schedule without using market forecasts to time each purchase. This implementation accepts a contribution amount and an interval, converts the contribution into units at the current close, and…
This utility tracks balances across configured exchanges and converts held assets into a combined net asset value using each exchange’s latest ticker price. It adds available and frozen cash balances, values available and frozen holdings at the last price,…
This framework example shows how to combine manual equity selection, alpha insights, portfolio construction, and execution components. It selects SPY and IBM, emits a one-day upward insight for SPY and a downward insight for IBM, and applies a long-only…
This machine learning example uses a two-layer LSTM to produce daily stock weights for a NASDAQ-100 universe. For each training asset, it uses the one-period rate of change of a linearly weighted moving average of closing prices as its feature, and labels…
This example demonstrates how cash dividends are represented in an equity backtest when data normalization is set to raw. It subscribes to daily Microsoft data, sets a starting portfolio, and takes a holdings position. The algorithm checks incoming data for…
This Python module adapts the Double-7 mean-reversion approach, described as originally designed for ETFs, to a portfolio-like comparison of lookback periods. Each period is represented as a separate symbol, allowing the user to examine several versions of…
This QuantConnect framework example demonstrates using an ETF constituents universe selection model with SPY as the source ETF. It filters constituent records to those with available weights, sorts them from highest to lowest weight, and selects the top…
This code example constructs NASDAQ-100 portfolio weights using a liquidity measure and an ATR-based volatility filter. It calculates 14-period ATR relative to closing price and assigns zero weight when that ratio exceeds a chosen threshold. Otherwise, each…
This cross-sectional stock strategy ranks securities by price-to-book ratio, using book value per share calculated from total assets, total liabilities, and shares outstanding. It buys the lowest-ratio group and shorts the highest-ratio group, with the…
This workflow proposes finding candidate tokens by starting with a successful seed project, screening its holders, and examining the other ERC-20 assets held by qualifying wallets. The described filters exclude large project holders and labeled institutions,…
The document describes a portfolio strategy for BTC, gold, a US equity index, and crude oil perpetual contracts. It estimates covariance from recent 15-minute log returns with an EWMA scheme, then iteratively assigns weights intended to equalize assets’ risk…
This document describes a spot crypto strategy that seeks to keep the account value split roughly evenly between a coin and cash. It estimates the coin’s share of total account value from the latest price and account balances. When that share moves outside…