This source describes a simple portfolio rebalancing loop for an account holding cash and one asset. It compares the cash balance with the market value of the holdings, then estimates the amount needed to bring the two sides toward equal value. If the…
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 long-only strategy buys when a five-period RSI falls below its oversold threshold while price remains above the 200-period simple moving average. The moving average is intended to restrict entries to an uptrend. It uses a stop based on 1.5 times the…
This script turns a price channel into a two-sided breakout strategy. It calculates the highest high and lowest low over a configurable lookback, then places stop entries at those channel boundaries when the corresponding long or short direction is enabled.…
This script outlines a daily VWAP mean-reversion approach. It calculates VWAP and a volume-weighted standard deviation from the current session, then treats the prior close outside the one-standard-deviation band as a setup: above the upper band for a short,…
This Turtle-style example combines short- and long-period price breakouts with ATR-based sizing and staged position additions. It calculates true range and averages it over a volatility period, then sets the initial trade size as a fraction of account equity…
This Bybit perpetual-futures strategy uses fast and slow moving averages, closing prices, and recent candle direction to manage a single long or short position. A long setup requires the close to be above both averages and the fast average to be rising; the…
This strategy uses a configurable moving average as an entry signal and trend baseline. Its described setup goes long when price crosses above a Hull moving average and short when price crosses below; a McGinley or other selected baseline can confirm…
This strategy combines moving average trend signals with volatility breakouts. A 12-period EMA crossing above a 26-period EMA signals a long entry, while a cross below signals an exit or short condition. In an existing bullish trend, a close above the upper…
This strategy detects bullish and bearish fair value gaps using candle relationships across the current or selected timeframe, with a body-size threshold to filter smaller formations. It can require the direction of an IIR low-pass trend filter to agree with…
This plugin places a sequence of limit orders at fixed price intervals, for opening or closing futures positions. A user selects buy, sell, buy-to-close, or sell-to-close; sets a starting price and spacing; and specifies the order count and base quantity.…
This short-term strategy uses a moving average to define a downtrend and RSI as an entry filter. It opens short positions when the close is below the moving average and RSI is above 30, then exits when price reaches a stop 3% above the entry or a target 2%…
This long-only mean-reversion setup looks for a two-candle return inside the lower Bollinger Band. The first candle must close below the band, and the next must close back above it; the strategy then places a buy stop at the second candle's high. Its bands…
This partial script excerpt lays out configurable controls for an NQ or MNQ strategy, including a volume-spike multiplier against a recent average, optional EMA and session filters, and an optional morning-bias filter. It provides fixed-distance or…
This short-term short-selling system uses Roni’s Adjusted Hybrid Average (RAHA), which weights prices less when they lie farther from the period mean relative to standard deviation. It combines RAHA averages of 5, 10, 20, and 40 periods to identify downward…
The strategy combines a channel formed by three EMA periods with RSI confirmation to enter in the direction of a price move through the channel. ATR is described as a basis for stop placement and position sizing, while a preset reward-to-risk ratio…
This long-only system enters on a bullish engulfing candle that passes a minimum-volume filter. It derives a stop distance from the spread between 40-period Bollinger Bands, risks a fixed share of account equity per trade, and sets a profit target at four…
This strategy looks for an inside bar, defined as a candle contained within the preceding candle’s range. It takes the direction from the preceding candle: a bullish candle sets a buy stop above its high, while a bearish candle sets a sell stop below its…
The document describes a Turtle-style channel breakout system with fast and slow lookback settings. Stop entries are placed at recent highs for longs or lows for shorts, while exits use opposing channel levels. Users can enable either or both speeds and…
The document describes a volatility-scaled trailing stop strategy. It multiplies ATR by a user-set sensitivity factor to determine the stop distance, then updates the stop as price moves. A signal is generated when the selected price source crosses the stop;…
This long-only strategy combines fast, slow, and reference simple moving averages with configurable price offsets. It seeks an entry when price is below the reference average, sufficiently distant from the slow average, the fast average is rising, and the…
The visible Pine Script excerpt defines a trend-following strategy based on the slopes of five exponential moving averages, with lengths ranging from short to longer-term. Each slope measures percentage change over a configurable lookback. A bullish ribbon…
This BTC futures system builds rolling resistance and support levels from a weighted price calculation using the high, low, and close. It enters long when the current high reaches or exceeds the prior bar’s resistance, and short when the low reaches or falls…
This long-only reversal strategy calculates a 14-period RSI from daily lows rather than closing prices. It enters when RSI falls below the default entry threshold of 24, then closes when RSI rises above 72 or when the loss from the recorded entry price…
This example describes a spread-trading strategy that manages long and short spread positions through separate opening and closing algorithms. During a configured session, it starts both long-entry and short-entry algorithms when flat, using target prices, a…