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…
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
148 documents
This document describes a long-only dollar-cost averaging backtest. It opens a base position within a selected date window, then places a series of lower-priced safety orders. The order levels step farther apart according to a scale factor, while order size…
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 strategy places a sequence of buy and sell levels across a price range. The range can be set manually or estimated from recent closing prices using highs and lows, or an average with a deviation. Grid spacing follows from the range and the selected…
This strategy combines pivot-based fractal levels, ATR, and a simple moving average to set up adaptive grid trades. It identifies local highs and lows, then places prospective limit entries at levels offset from those pivots by ATR multiples. A volatility…
This MetaTrader expert advisor combines linear regression candles with MACD to identify pullbacks in the direction of the indicator trend. For a long signal, MACD must remain positive, while the latest regression candle closes above both its open and signal…
This short-term pullback strategy combines ATR-based price levels with volatility and RSI filters. It describes calculating a 10-period ATR and using a grid factor of 0.2 to generate 15 levels. Long signals require price below the first level, sufficient…
This grid strategy places limit orders above and below the current market price, opening short positions on the upper side and long positions on the lower side according to the selected grid mode. It tracks open position amounts and combined unrealized…
This document describes a contract grid strategy with long, short, or two-sided operation. It places orders across a price range anchored to an initial or current price, aiming to capture repeated moves between grid levels. Grid count is calculated…
This script describes a long-only grid approach for XLM perpetual markets. It defines fixed upper and lower price bounds and distributes grid levels between them using either geometric or arithmetic spacing. A downward crossing of a grid level triggers a…
This document describes a research prototype for a long-only grid strategy on linear perpetual futures. Its overview says a small initial entry, dynamically adjusted grid spacing, and fractional Kelly sizing work together to manage the strategy budget. The…
The document describes a range-based grid strategy that divides a user-defined price channel into levels. It opens an initial long position inside the channel, adds positions as price reaches new levels, and tracks each entry separately. Each grid position…
This document describes a grid strategy that divides a chosen price range into evenly spaced levels. Bounds can be set manually or derived from recent highs and lows or a moving average, with a deviation adjustment. The strategy places buys and sells as…
This grid strategy divides a price range into evenly spaced levels and opens fixed-size long positions as price moves below grid lines. When price rises past the next level, it closes the position associated with the lower line, seeking to capture…
This long-only grid strategy operates between fixed upper and lower price bounds. It divides the range into configurable levels, using either geometric or arithmetic spacing, buys when price crosses down through a level, and sells on an upward crossing at…
This Pine strategy builds evenly spaced price levels between an upper and lower bound, then prepares a grid of order states for trading. Bounds can be supplied manually or calculated from recent closing-price highs and lows, widened or narrowed by a…
This spot trading routine rebalances a coin and USDT toward a configured target share of portfolio value. It reads account balances and the ticker, values the coin holdings at the sell price, and compares that value with the target allocation. If the…
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 BTC grid strategy alternates between long and short futures positions at configurable price thresholds. When flat, it opens a base position in the direction associated with the current price region: long below a lower threshold or short above an upper…
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 scalping system combines three MACD readings with progressively slower fast and slow periods. Its long and short rules look for momentum alignment across the slow indicators, then inspect recent history for zero-line crossings and turning points in…
This teaching example repeatedly cancels its outstanding orders, reads the current ticker and account balances, then places buy limits below and sell limits above the midpoint. Each side adds orders at successive price intervals until its configured quantity…
This Expert Advisor combines three moving averages with Williams Fractals to identify possible entries. For a long trade, the averages must be ordered from shortest-period highest to longest-period lowest, and the previous candle’s low must sit between the…
This strategy trades a three-contract spread across a perpetual, current-quarter, and next-quarter Binance coin-margined futures contract. It defines the butterfly spread as next-quarter plus perpetual minus twice the current-quarter price. Long exposure to…