This document presents a single-asset rebalancing method that compares an account’s cash balance with the marked value of its crypto holdings. When the imbalance exceeds a configurable threshold, it buys or sells part of the asset to move the two sides…
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
4,613 documents
This script combines MACD crossovers with price breaks above recent pivot resistance or below pivot support. It adds direction checks from the 14-period RSI and positive or negative directional indicators, and requires ADX to exceed a threshold before taking…
This algorithm example demonstrates how to select and open an index put butterfly using weekly SPX options. It subscribes to SPX index data and SPXW options, filters for expirations 15 to 45 days away and strikes within three increments of the underlying,…
This single-venue strategy aims to keep the cash balance and the marked value of a crypto holding near parity. It compares the account’s cash with the asset value, then calculates half the difference as the amount to shift: buy when cash exceeds the…
This strategy example uses the crossover of short and long moving averages to identify possible trends and enter long positions. It calculates the averages from recent bar closes and combines trend direction with thresholds for the average spread and…
This strategy script describes two selectable trading modes, labeled Break and ABLC, with an option to compare them. It exposes direction controls, a per-trade risk setting, a one-trade-per-day limit, and a time-based exit. Backtests can be restricted to a…
This document describes a periodic averaging strategy implemented for a crypto derivatives exchange. It opens an initial position, then checks unrealized profit or loss after each configured interval. If the position is losing by more than a chosen…
This strategy trades a basket of Binance USDT perpetual contracts against BTC. It tracks each coin’s price relative to BTC and compares that ratio with a baseline that is updated using an exponential moving average. The mean of the basket’s relative changes…
This Indian equity swing strategy adapts the Turtle trend-following approach with separate 20-day and 55-day Donchian breakout systems. It describes exits using shorter Donchian channels and adds an EMA trend filter, an RSI threshold, volume confirmation,…
This long-only strategy uses a long-term EMA as a trend filter and places a limit buy order at a shorter EMA when price is above that filter. Its stated design aims to enter on pullbacks while trading in the direction of the broader trend. The accompanying…
This swing-trading framework combines four kinds of analysis: Wyckoff market phases, simplified volume-profile levels, mean-reversion signals, and trend following. It uses price and volume to classify accumulation or distribution, POC and value-area levels…
This strategy combines as many as five separately configured RSI series. Each has its own period and threshold. When an enabled RSI falls below its threshold, the strategy can enter long; it records the highest-period active trigger as the signal strength…
This document outlines an intraday trend-following approach for Nasdaq 100 micro futures. It uses a fast and slow EMA crossover to signal direction, then checks that price is on the matching side of VWAP before entering. ATR sets different stop distances for…
This strategy places buy and sell triggers on a grid whose center and levels adjust as a smoothed price reference changes. The user can select among several moving-average methods, choose whether signals use highs and lows or closes, and set grid spacing,…
This QuantConnect example demonstrates how a custom buying power model can change order sizing and buying-power checks in a backtest. It applies the model to hourly SPY data, rounds the maximum order quantity down to a multiple of 100 shares, and then…
This strategy uses On-Balance Volume to identify an upward trend, then builds a long position through repeated entries. A signal occurs when OBV, centered by its moving average, crosses above zero while the fast EMA is above the slow EMA. The source allows…
This trend-following system uses momentum over a configurable lookback and enters when the previous momentum reading is higher than the two preceding readings, or lower than both for a short signal. Its documented default momentum period is 2. At entry, it…
This strategy defines hammer and shooting star candles using the candle body and wick proportions. A hammer must be bearish, have a lower wick at least 0.9 times its body, an upper wick no more than 0.45 times the body, and a body at least 20% of the full…
This short term strategy uses Stochastic RSI to identify overbought and oversold conditions for reversal entries. It derives Stochastic RSI from RSI, smooths the indicator, and looks for a crossover or crossunder in the relevant extreme region. A fast versus…
This strategy uses a 14-period RSI on an M5 timeframe to seek reversals from extreme readings. It enters long when RSI falls below 30 and short when RSI rises above 70, but only during a specified daily trading window. Each trade has a fixed 1% stop and 2%…
This Pine Script strategy is designed to turn plotted indicator values into orders on a chart. It offers signal modes for signed pulses, threshold crossings, two-series crossovers, separate trigger series, and three-source logic. A built-in volume mode…
This document describes a grid strategy that places buy and sell orders across a defined price range. It opens a position when price moves across a grid level and closes it when price crosses back through the adjacent level, aiming to harvest repeated price…
This Pine Script excerpt describes a configurable framework for evaluating trade exits and risk settings. It offers a choice between a risk-to-reward target and fixed percentage take-profit and stop-loss levels. In risk-to-reward mode, the target ratio is…
This strategy uses Kaufman’s Adaptive Moving Average (KAMA) as its trend signal, with configurable lookback and fast and slow smoothing lengths. A long setup requires KAMA to rise over a chosen interval, price to be above a simple moving average regime…