This strategy uses a fast, medium and slow EMA to define the broader trend, then looks for a pullback and a renewed move through the fast EMA. The example uses 25-, 100- and 200-period averages: bullish alignment requires the fast EMA above the medium EMA…
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 Pine Script strategy accepts an external buy or sell signal and manages one open position at a time. Same-direction signals are ignored while a position is open. An opposing signal can be configured to do nothing, close the position, or close it and…
This strategy looks for breakouts from unusually narrow ranges in the Relative Strength Index. It measures the recent RSI high-to-low range, ranks that range against its historical window, and treats a low percentile rank as a squeeze. A long signal occurs…
This BTC futures strategy uses a Fisher Yurik indicator derived from price extremes over a selected period. It opens a long position when the positive-side Fisher series rises from its prior value. The description presents a percentage-based profit target…
This Bitcoin trend-following approach uses a fast and a slow moving average to define direction: an upward crossover signals a long entry and a downward crossover signals a short entry. RSI acts as a directional filter, allowing long entries above 50 and…
This short programming exercise demonstrates an RSI-based trading loop. It reads the latest market quote, account balances, and four-hour records, then calculates a 14-period RSI. When RSI is above 70 and the account holds the asset, it submits a sell order…
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 document presents a reusable backtesting template with placeholders for custom indicators, entry and exit rules, and signal generation. Its example logic uses RSI conditions, while optional ADX filtering can restrict trades to periods when the indicator…
This strategy opens a short position when a candle closes more than a configurable percentage above the upper Bollinger Band. It uses three staged entries with increasing dollar allocations: the first opens on the signal, while later entries are intended to…
This intraday strategy pairs reversal candlestick patterns with MACD crossover confirmation. Bullish engulfing candles or hammers can support a long signal when MACD crosses above its signal line; bearish engulfing candles or shooting stars can support a…
This educational example calculates order quantity from a chosen risk budget and a stop-loss distance expressed as a percentage of entry price. The risk budget can be set either as a percentage of account equity or as an absolute money amount. The code…
This strategy uses a fast and a slow moving average to define directional trades: an upward cross opens a long, and a downward cross opens a short. The document presents dynamic position sizing based on account equity and a user-defined risk setting,…
This document presents a reusable Pine Script framework for backtesting strategies. Its stated design separates trade management from signal generation: a trader supplies conditions for starting and ending long or short positions, while the framework…
This Pine Script outlines a long-only strategy intended for weekly charts. It enters when the closing price lies between two Hull moving averages, the MACD histogram is below zero, and both a nine-period RSI and its short moving average cross above a longer…
This Pine Script strategy builds a price range from the 08:00–08:15 New York session, locks its high and low, and tracks closes that break outside the range. During the 09:45–11:00 window, it enters when price retests the midpoint in the direction of the…
This workflow describes automated long and short trading for USDT-margined perpetual futures. On a candle-close trigger, it reads account balance and market contract specifications, then calculates an order quantity from a configurable share of available…
This script describes a moving-average breakout approach using a configurable 200-period EMA, SMA, or HMA, with a 15-minute EMA as a higher-timeframe filter. Inputs allow adaptive filters, distance limits from the averages, and a slope filter. The visible…
This document describes a simple RSI-based trading bot for a spot account. It calculates RSI over a configurable period and uses configurable buy and sell thresholds to trigger trades. The entry logic compares recent RSI readings to detect a turn across a…
This strategy tracks the current and previous three-hour candle ranges, even when run on another chart timeframe. If the current H3 range exceeds the previous candle’s high, it sets a short bias; if it falls below the prior low, it sets a long bias. A trade…
This proof-of-concept strategy combines recurring purchases with indicator-based entry and exit conditions. Its internal example uses RSI relative to Bollinger-style bands around RSI to trigger additions and exits, while allowing users to substitute external…
This strategy pairs RSI thresholds with Bollinger Band crossings to generate long and short signals. The long rule requires a short-period RSI to cross above its oversold threshold while price crosses above the lower band. The short rule requires a…
This Pine Script template restricts entry evaluation to a user-defined exchange-time session. It tracks the session high and low, plots those levels alongside fast and slow exponential moving averages, and lets the user choose between a session-range break…
This long-only setup requires three conditions at once: current volume above twice its recent average, a minimum gain from the recent closing-price low, and momentum confirmed by price above a moving average with RSI above a threshold. The strategy then…
The strategy uses Donchian channels of different lengths to trade breakouts. A longer lookback identifies major direction, while a shorter channel supplies an opposing-boundary exit. The described method also sizes positions from a chosen equity risk and an…