A long and short strategy using a long simple moving average with bands set a chosen number of standard deviations above and below it, 350 bars by default. It goes long when price closes above the upper band and exits when price falls back under the average; i
A strategy-type script for the price chart that marks the high, low and midpoint of the first part of each session, set by start hour and minute inputs, and alerts when price crosses above the high or below the low. It also plots VWAP and a 50-period EMA, pivo
A refactored version of a triple SuperTrend overlay. Each of three lines is calculated through helper functions from an ATR period, multiplier and a shared price source, with an option to use wicks or closing prices. Long stops plot in green and short stops in
This strategy implements custom trailing stop logic driven by momentum signals. It calculates first- and second-order price momentum, entering long or short via stop orders above or below the current bar when momentum is consistently positive or negative. A cu
A two-sided mean reversion strategy built on a very short RSI and a 200-period SMA. Longs are taken after a deeply oversold RSI reading while price is above the SMA, and shorts after an overbought reading below it, with RSI-based closing rules. Stop loss, take
An overlay for crypto, stocks and commodities that runs two parallel sets of the same staged logic, each with its own RSI length and 21, 50, 100 and 300-period simple moving averages. The logic flags bearish candles with RSI below 20, tracks crosses above the
TrendGlow is a price-chart indicator that recolors candles according to a bullish, bearish, or sideways trend. It imports a BullBear library and can combine Stochastic RSI, MACD, and SMA checks on a user-selected timeframe through request.security. Users toggl
This long-only strategy plots Bollinger Bands, 20 bars and 2.5 deviations by default, along with a 10 and a 50 period EMA and a background that shades the EMA trend. When flat, it buys after the close crosses back above the lower band, and it closes the positi
This strategy uses a 14-period RSI with fixed thresholds. It goes long when RSI crosses above 60 and short when it crosses below 40. Each side has a percentage trailing stop, two percent by default, that follows the close and only moves in the trade's favour;
A long-only strategy that buys when the 14-bar RSI is below 30 inside a chosen date range. It closes all positions when price reaches a percentage profit target or falls to a percentage stop loss, checked on closes. The order size doubles after each close, a p
Calculates and plots customizable Ichimoku Kinko Hyo components directly on the price chart. It provides options to display standard Ichimoku lines including Tenkan-sen, Kijun-sen, Senkou Span A, Senkou Span B, and Chikou Span, as well as an overlay for the Ic
A Pine v5 library of ancillary functions for the author's Woodwind Playbook script. It includes a function that returns the midpoint between the highest high and lowest low over a period, and another that returns the bar positions and values of the highest hig
A long-only strategy designed for the 4-hour chart. It averages open, high, low and close, smooths that with a mid-term SMA and builds a relative strength line from the gap between price and the SMA. When the slope of that line turns positive it places a limit
A separate-pane indicator that calls an imported helper library to test SMA, MACD, RSI and DMI conditions for long and short setups, plus an ADX check. It plots a green line at 1 when all four long conditions are true and a red line at minus 1 when all four sh
This indicator calculates volatility-based envelopes directly on the price chart. It plots a central exponential moving average of closing prices alongside asymmetric outer bands. The upper band is derived from an EMA of price highs plus a standard deviation o
A strategy that combines several filters on one chart. Components include an ignition bar marker based on a candle body retracement percentage, fractal detection, three configurable moving averages, an RSI with overbought and oversold levels, a trading range l
This Pine v5 strategy calculates a 20-period Bollinger Band basis and places stop-style entry orders at the basis. A long order is placed when the close crosses above the basis and a short order when it crosses below, and pending orders are cancelled on bars w
This indicator ranks the current Bollinger Band width against its own recent history to give a percentile from zero to one hundred, drawn in a separate pane with a moving average of that value and extreme high and low levels at 98 and 2 by default. It also cal
This strategy enters long when a bullish candle closes above an EMA and its upper wick is no larger than a set percent of the candle range, and short on the opposite bearish setup. It closes a long after price rises a small fixed fraction above the entry bar o
This indicator calculates an ATR trailing stop line derived from the highest high minus an average true range multiple over a specified lookback period. It plots the trailing stop line directly on the price chart and colors price bars based on whether the clos
ArrayExtension is a Pine Script v5 utility library that provides helper functions for array manipulation. It includes routines to convert multi-dimensional matrix coordinates, such as 2D and 3D index positions, into flattened single-dimension array indices wit
This indicator plots optional candlestick pattern signals on the price chart. It detects engulfing bars, inside bars, HOLP and LOHP, kicker patterns, body-mass extremes, higher highs and lower lows, ATR warnings, and four-bar fractals. Optional pivot marks use
This indicator generates trade entry signals and target levels optimized for 1-hour timeframes, designed for external signal extraction. It calculates 7-period and 16-period EMAs alongside 10-period RSI and ATR filters. Long signals occur when the fast EMA cro
This indicator classifies the next market direction with a two-feature k-nearest neighbours model. It stores normalized historic indicator values and past directions, then compares the current point to the nearest neighbours using Euclidean or Chebyshev distan
This strategy draws on the price chart and combines Stochastic RSI, the Money Flow Index, and an exponential moving average to open long or short trades. Longs use the lower oscillator thresholds and shorts use the upper ones, with direction limited to longs,
This strategy plots a fast and a slow simple moving average on the price chart. It enters a long position when the fast average crosses above the slow average and closes that long when the fast average crosses below the slow average. Percentage take profit and
This strategy plots the previous daily high and low on the price chart and calculates the Andean oscillator bull and bear components with an exponential moving average signal. It looks for a bull or bear cross of that signal, then confirms the setup against re
This Pine Script strategy demonstrates the usage of bar state variables by highlighting the chart background color. It evaluates whether the current candle is the final bar on the chart using the barstate.islast condition and applies a silver background color
This strategy executes trades on the current chart based on daily percentage price changes of an external ticker (GOOG). It fetches the daily open and close prices of the reference symbol to compute its intraday price change ratio. When the reference asset dro
This indicator draws ICT killzone boxes on the price chart for Asia, London, New York AM, New York lunch, and New York PM sessions. Each session can be toggled, renamed, and recolored, with optional labels and adjustable box transparency. A session drawing lim
Indicatorv5SMC / ICT / price actionSessions & time
Force Bar highlights candlesticks directly on the price chart using three distinct body and range criteria: widest range (Biggest), extreme body relative to historical average (Exhaustion), and moderate body relative to historical average (Force). Colors apply
MACD Histogram Percentile Rainbow calculates the standard Moving Average Convergence Divergence line, signal line, and histogram in a separate indicator pane. It evaluates the relative magnitude of histogram bars against historical data using a percentile rank
This strategy overlays the price chart to execute long and short trades on BTCUSDT. It requests multi-timeframe data across daily, 3-minute, 5-minute, 8-minute, and 10-minute periods to generate signals alongside VWMA volatility bands and smoothed moving avera
This strategy draws on the price chart and trades both directions. It enters long when a variable moving average crosses above the Optimized Trend Tracker while price is above a fast EMA, and short on the opposite cross below a slower EMA. Entries are blocked
This indicator plots an Advance Decline Line in a separate pane. It requests a combined NYSE series of advancing issues minus declining issues, divided by unchanged issues plus one. A cumulative function adds the square root of a positive difference and subtra
The Supertrended RSI [AlgoAlpha] indicator plots the Relative Strength Index combined with a Supertrend overlay in a separate indicator pane. It first computes standard RSI, with an optional Hull Moving Average smoothing step, and computes a secondary moving a
This indicator maps Smart Money Concepts (SMC) market structure directly onto the price chart. It detects internal and swing structure breaks (BOS and CHoCH), tracks bullish and bearish order blocks, identifies fair value gaps (FVG), highlights equal highs and
Benso Pendulum is an indicator that plots a customizable Relative Strength Index (RSI) oscillator in a separate pane on the price chart. It calculates the RSI using the specified source and period, applying dynamic colors that change based on overbought and ov
Implements John F. Ehlers' convolution algorithm to detect cyclic components across multiple periods. The script processes price data using a SuperSmoother filter with an optional high-pass filter to remove low-frequency trends. It computes cross-correlations
This indicator plots RSI in a separate pane and compares oscillator pivots with price to mark regular bullish and bearish divergences. Left and right pivot lookbacks and a minimum-to-maximum bar range control which swings qualify. Regular divergence labels are
This Pine Script library encodes string data into numeric byte arrays and RGB color objects. It maps characters against standard ASCII symbol sets and packs groups of three bytes into red, green, and blue color channels. Designed as an optical data transfer ut
Crossing EMAs A is an automated strategy that overlays directly on the price chart. Despite its title referencing exponential moving averages, the script calculates fourteen-period and twenty-eight-period simple moving averages. It enters a long position when
BTE AO is a Pine Script indicator based on the PineCoders Backtesting and Trading Engine framework. It simulates long and short trade entries, filters, stop losses, and take-profit targets directly on the price chart to evaluate trading strategies without nati
This strategy calculates volatility-based Chandelier Exit bands using the Average True Range and high/low extremes, paired with an optional exponential moving average trend filter. It enters long when the close crosses above the long Chandelier line while abov
This overlay strategy combines three distinct SuperTrend levels with multiple moving averages and volume profile analytics on the main price chart. It calculates trend directions using three configurable ATR periods and multipliers alongside SMA, EMA, and HMA
Calculates three-bar Fair Value Gaps (FVG) and filters them using Average True Range. When price mitigates the FVG midpoint, the strategy enters a position in the direction of the gap, provided an optional EMA trend filter is satisfied. Exits are defined by an
This overlay indicator draws Nadaraya-Watson smoothed Bollinger Bands on the price chart using short, medium, and long periods and deviations. A smoothing factor controls the kernel bandwidth, and an optional setting can allow the estimate to repaint. Users ca
This indicator detects 1v1 candle break patterns where the current candle breaks and closes beyond the open of the prior opposite-colored candle. It projects a 1.618 Fibonacci extension target based on the previous candle's range, calculating the expected perc
Third-party code. ForexR lists open-source Pine scripts from GitHub; it did not write, test or endorse them, and their summaries are generated automatically from each script's code and README. Indicators describe the past, and a strategy's backtest can look better than live trading. Check a script on a demo account before you rely on it. CFDs and leveraged forex are complex instruments with a high risk of losing money rapidly.
Learn to Use Pine Scripts
Free, plain-English guides: add a script to TradingView, read what it does, test it and avoid the common traps.