This long-only daily stock strategy looks for pullbacks within an established uptrend. It defines the bullish regime as the 50-period EMA above the 200-period EMA, with price above the faster average. After RSI has recently entered a pullback zone, it waits…
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
387 documents
This equity strategy ranks stocks by their trailing 252-day returns, after screening for average dollar volume above $10 million over 30 days. Each day before the market opens, it selects the three highest-ranked stocks. At a scheduled rebalance 30 minutes…
This strategy combines a moving-average trend filter with a breadth-style participation proxy and ATR-based exits. It treats the fast EMA being above the slow EMA as a bullish trend, and below it as bearish. The proxy is the rolling average of a binary…
This QuantConnect example demonstrates estimating the QC500 index constituents through the platform’s built-in universe selection. It configures daily data resolution, sets a historical test interval covering 2018, assigns starting cash, and adds the QC500…
This algorithm demonstrates how an options strategy helper can submit a covered put as a grouped position. It selects an option contract by closeness to the underlying price and then by expiration, constructs covered-put and protective-put strategy objects…
This QuantConnect demonstration shows how an algorithm can export portfolio targets to Collective2 when a fast and slow EMA relationship changes. It initializes SPY plus example equity, forex, futures, and options securities, warms up the indicators, and…
The strategy uses a 200-day simple moving average to identify the broad trend and a 10-day average to identify a short-term pullback. It proposes buying when the close is above the long average but below the short average, and selling short under the inverse…
Despite its pair-trading label, this document describes a long-only strategy for a single instrument. It combines three simple moving averages and two exponential moving averages with candle and volume conditions to create two alternative entry signals. One…
This notebook defines a bearish shooting-star candle using body and wick proportions, two preceding non-declining closes, and confirmation that the following candle’s high and close do not exceed those of the candidate candle. It marks confirmed patterns as…
The document presents a rules-based mean-reversion approach for TQQQ, a leveraged Nasdaq-100 fund. At Monday’s regular-session open, the strategy places a limit buy one percent below that price. After a fill, it sets a one-percent profit target for the next…
The document outlines a regime-based approach that uses SPY relative to its 200-day simple moving average to switch exposure between leveraged TQQQ and QQQ. The supplied script opens a long position when SPY closes more than 4% above the moving average and…
The visible portion of this strategy combines reversal signals near prior-day or premarket extremes with breakouts through those levels. It tracks prior-day highs, lows, and midpoint, along with premarket and current-session extremes. A reversal setup looks…
This example shows how to connect a custom coarse and fine fundamental universe selector to a sector-weighted portfolio construction model in an algorithm framework. It sets daily data resolution, defines a short test period and starting cash, then wires…
This tutorial template uses a Ridge Classifier to predict whether a stock's next closing price will be higher or lower than its current close. Its main example loads Amazon data from the Nasdaq-100 universe, uses log closing prices as features, and reserves…
This source describes a bar-based moving-average strategy that compares closing prices with a simple moving average and checks the latest price’s distance from that average. An upward-cross signal is intended to open long positions when both the bar close…
This short-term strategy combines three two-candle patterns: engulfing, harami, and harami cross. It classifies each bar by whether it rose, fell, or closed unchanged, then compares candle bodies and ranges to detect bullish or bearish patterns. Traders can…
This strategy seeks long entries after a bullish engulfing pattern appears in a downtrend. The setup is described as a small bearish candle followed by a bullish candle whose body engulfs the prior body and whose close exceeds the previous high. Trend…
This long-only mean-reversion strategy uses the 200-day simple moving average as a reference for large-cap stocks on daily charts. It enters when the price low falls to roughly 85–90% of the average, on the premise that a substantial decline may be followed…
This multi-market strategy combines a zero-lag exponential moving average with MACD crossovers, a 100-period EMA trend filter, and RSI-based exits. It calculates a ZLEMA from two successive exponential averages, derives fast and slow lines from that series,…
This example demonstrates using a persistent object store to cache historical data so later backtests can avoid repeating a costly history request. On the first run, it retrieves daily SPY closing prices, feeds them into price and exponential moving average…
This educational algorithm demonstrates order-ticket workflows for several order types using SPY: market, limit, stop-market, stop-limit, trailing-stop, and market-on-open and market-on-close orders. It shows that market orders may be handled synchronously…
This strategy uses a 200-day simple moving average as a trend filter and adds separate entry and exit buffers. It enters a long position when the reference price rises above the moving average by the stated entry margin, and exits below it by the smaller…
This long-only strategy uses a 50-period and 200-period EMA crossover on daily SPY data. It permits entries for a configurable number of bars after a bullish crossover, provided the fast EMA remains above the slow EMA and the separation and slow-EMA slope…
This intraday long strategy seeks bull flags in small-cap stocks during the morning session. It first detects a bullish impulse bar whose range exceeds an ATR-based threshold and whose volume is elevated relative to its moving average. It then tracks a…