This Pine strategy template supplies the execution and risk-management framework for a separately defined trading signal. It accepts an external indicator source, interpreting values as long or short entries and optionally as custom exits. Inputs govern…
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 strategy uses a simple moving average of closing prices to define crossover entries: a move above the average triggers a long signal, and a move below triggers a short signal. Its configurable average length controls the lookback. Users can allow both…
This swing strategy treats a small-body candle relative to its high-low range as a doji setup. It places opposing stop orders around the doji or, under a condition involving the prior candle, uses the prior bar’s extremes to define entry levels. The first…
This Bitcoin strategy looks for pullbacks in the direction of a broader trend. It combines a higher-timeframe exponential moving average with faster and slower averages on the chart, then filters potential entries using ADX, directional indicators, RSI, and…
This long-only strategy for LTC against USDT arms an entry when a 14-period RSI on a four-hour timeframe falls below 29 and the chart close is under a configurable price ceiling, set to $61 by default. After the base order, it can add four averaging orders…
This long-only strategy for XRP perpetuals arms an entry when the 4-hour RSI(14) falls below 28. It starts with a base order, then adds up to five safety orders at fixed price declines from the base entry. The default order sizes grow at roughly 1.8 times…
This script describes a long-only grid for TWT priced in USDT. It places a series of levels between configurable high and low bounds, using either geometric spacing, which maintains proportional gaps, or arithmetic spacing, which maintains equal price gaps.…
This Bitcoin-focused system combines a modified MACD-style signal, a long-period RSI filter, and a price midpoint calculated from the recent high and low range. It uses the difference between 15- and 30-period EMAs, smoothed by a 9-period EMA; long and short…
This strategy requires a single candle to cross both an exponential moving average and a selected pivot level. A bullish candle must open at or below both levels and close above them; the short setup reverses those conditions. Pivot levels can use Fibonacci…
This strategy seeks pullbacks within a strong trend. It defines direction with a long-period exponential moving average and directional indicators, requiring the average directional index to exceed a threshold. A confirmed pivot low can trigger a long entry…
This educational example explains how a Pine Script strategy can model leveraged position sizing and broker margin requirements. For percent-of-equity sizing, the author describes scaling the order percentage by the leverage multiple: using 3000% represents…
This strategy treats the recent high-low range of RSI as a measure of momentum compression. It ranks that range against its own history and marks unusually narrow ranges as squeezes. If a squeeze occurred recently, a move above the prior RSI range can…
This strategy script backtests a grid whose levels can be spaced arithmetically or geometrically around a reference price. It supports neutral, long-only, and short-only modes, with entries triggered by level crossings or pullbacks. Users can set a test…
This Pine strategy combines five configurable ICT/SMC-style entry modules: acceptance and rejection around pivot support or resistance, swing failure patterns at prior weekly extremes, higher-timeframe liquidity, displacement, and fair value gaps. The…
This long-only strategy tracks recent structure highs and lows, then looks for a low sweep followed by recovery and a close above the previously recorded structure high. After that breakout, it places a limit entry at either a chosen Fibonacci retracement of…
This strategy combines moving-average crossover signals with filters intended to control when trades are allowed. The visible code offers TEMA, Hull, or ALMA smoothing, optional alternate-timeframe signals, and optional Heikin-Ashi prices. It also checks…
This strategy uses a seeded pseudorandom-number routine to trigger entries and exits when generated values fall below fixed probability thresholds. Users can enable long or short trading; the script sets position size as a percentage of equity, disables…
This TradingView strategy divides a fixed BTCUSDT perpetual-futures price range into configurable levels, using either geometric or arithmetic spacing. It allocates the stated total investment evenly across levels. When a bar closes through an unowned level…
This strategy trades pullbacks around a 21-period exponential moving average, using a smoothed version of that average as a directional filter. Long setups require the smoothed line below the EMA, a prior-bar low reaching the EMA, a close above the EMA and…
This daily strategy for Grupo Financiero Galicia’s ADR uses moving-average crossovers to build and exit a long position. A faster average crossing above a medium average triggers an entry during a configurable backtest window. The script allows either…
This configurable strategy combines trend pullbacks, compression breakouts with optional retests, and failed-breakout liquidity sweeps. Signals can be filtered by indicators and context, including RSI, moving averages, relative volume, higher-timeframe and…
This strategy identifies an inside day when the prior daily high and low both fall within the range from two days earlier. During the configured session, it places stop entries at the prior day's high and low, with options to trade long, short, or both…
The Bastion Execution Protocol is a configurable intraday strategy that combines market regime, structure, momentum, and order-flow filters. It classifies conditions using normalized VWAP slope, moving-average alignment, and Bollinger Band width; detects…
This strategy looks for long breakouts in stocks that are consolidating near a fast exponential moving average and trading close to their 52-week high. It triggers when the close exceeds the highest high over a recent lookback and relative volume clears a…