This strategy uses a higher-timeframe candle pattern to establish directional bias, then maps a swing on a lower timeframe and looks for an entry when price retraces to its 50% level. The documented model places a stop beyond the swing’s starting point and…
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
862 documents
This script describes an intraday options approach that opens short call and put positions around the current underlying price, using a configurable strike offset and simulated base premium. Its state-machine setup tracks the selected strikes, position…
This strategy seeks to re-enter an established trend after a countertrend pullback. It defines the trend using the relationship between fast and slow EMAs and the slow EMA’s slope. A short-period RSI detects a pullback, and a price close beyond the previous…
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 calendar-based strategy attempts to buy gold at the start of Friday’s session and close the position later in the session. It includes configurable start and end dates for backtesting, along with commission, slippage, order-processing, and position-size…
This open-source strategy framework combines several market filters: a smoothed regime band, normalized pressure measures, participation across price levels, recent price structure, and an optional higher-timeframe directional bias. It also offers optional…
This utility automates selling holdings across a user-specified list of spot trading pairs, a task that can arise when stopping a multi-pair grid or martingale system. It repeatedly checks each pair, combines available and order-frozen balances, estimates…
This automated trend system combines an 8-period EMA direction filter with pivot highs and lows to place breakout stop orders. It enters long above a recent pivot high when the EMA is rising, or short below a recent pivot low when the EMA is falling. The…
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 algorithm constructs a call butterfly from SPX weekly index options. It queries contracts within a selected expiration range and near the underlying index level, chooses the nearest expiry, and looks for three call strikes arranged symmetrically around…
This Python example demonstrates an iceberg-style execution workflow for a futures contract using a trading API’s target-position task. The user specifies a target trade amount, a minimum and maximum order size, a buy or sell direction, and an execution…
This document describes a multi-symbol perpetual-futures strategy whose trading logic is delegated to external services. Its main loop polls for stop commands, applies strategy interactions and symbol selection, checks entry signals, processes reduction…
This controller coordinates multiple configured grids for one trading pair. Each grid has a price range, limit price, side, enable flag, and share of total quote capital. The controller checks the mid-price and creates a grid executor when price is within…
This short-term breakout method uses VWAP as a directional reference. It identifies a sequence of rising or falling closes around VWAP, records a relevant bar's high or low, and enters when price later breaks that level. Positions are closed when price…
This example schedules a target futures position across a chosen trading window using historical intraday volume patterns. It divides the session into fixed-length time cells, calculates each cell’s share of total session volume for each selected prior…
This automated spot-trading script describes a long-only approach using MACD and price conditions. It checks for enough historical bars, then enters when the MACD difference is positive and the histogram moves above a configured threshold after being below a…
This script implements a basic one-sided grid for a spot-style exchange interface. It places a limit buy below the current price, or below a user-specified starting price, using a configured price interval. The buy size is calculated as a percentage of the…
This scalping approach calculates a linear regression estimate and places upper and lower trigger levels around it using a configurable price gap. It buys when the close falls below the lower level and sells short when the close rises above the upper level,…
This Chinese-language example describes an automated hedge between OKX and Binance perpetual futures. It reads signed position sizes and quotes from both venues, tracks progress toward a requested amount, and uses an opening spread threshold to trigger…
This example demonstrates adding futures subscriptions for an equity index and a metal with extended market hours. It applies an expiration filter to each futures chain, then inspects available contracts and selects one whose expiry is more than 90 days…
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…
This example describes a mean-reversion approach to the price spread between near- and far-month index futures contracts. On 15-minute bars, it calculates the difference between the contracts’ closing prices over an 80-bar window, then estimates the spread’s…
This strategy uses a 20-period simple moving average and bands set two standard deviations above and below it. It describes buying when price crosses back above the lower band and selling when price crosses back below the upper band, with the sell signal…