Pine Library · 4,367 open-source scripts

Free Pine Script v6 Scripts (page 90)

Scripts written for Pine Script version 6, the current version of TradingView's language. They paste into the Pine Editor and run as they are.

Pine scripts4,367
Code shown here2,412open licence
Updated in a year4,021
No repaint flag3,857

Pine Script v6: Indicators, Strategies and Libraries

Skewness (SKEW)

by mihakralj
99 stars

This indicator calculates the population skewness of a chosen source over a rolling lookback, using the Fisher-Pearson coefficient. It keeps rolling sums of the mean, variance, and third central moment, then divides the third moment by the cubed standard devia

Indicator v6
Updated 4 weeks ago · Apache-2.0 GitHub repository of Skewness (SKEW)
1 stars

The Kiln Power Efficiency strategy computes an EMA trend line and a squared displacement efficiency metric from price moves relative to ATR. It plots both on the price chart. The strategy enters long trades on EMA crossover above the trend when efficiency exce

Strategy v6 TrendMoving averages
Updated 6 days ago · Apache-2.0 GitHub repository of PineForge — Kiln Power Efficiency

Solar Cycle (SOLAR)

by mihakralj
99 stars

This indicator calculates a solar cycle from each bar's open time using the Sun's ecliptic longitude. The result runs from about -1 at the winter solstice through 0 at the equinoxes to about +1 at the summer solstice, and it is plotted as a yellow line in a se

Indicator v6
Updated 4 weeks ago · Apache-2.0 GitHub repository of Solar Cycle (SOLAR)
1 stars

This strategy enters long when the fast EMA crosses above the slow EMA and RSI exceeds the entry threshold. It closes when the fast EMA crosses under the slow EMA, RSI falls below the exit threshold, or the open position reaches the maximum hold bars. A stop s

Strategy v6 TrendOscillators & momentum
Updated 6 days ago · Apache-2.0 GitHub repository of PineForge — Lattice Confirmed Pivot
99 stars

This indicator calculates the Spearman rank correlation coefficient between the chart asset and a secondary ticker, plotting the resulting values between minus one and plus one in a separate pane. It ranks price data over a specified lookback period and applie

Indicator v6
Updated 4 weeks ago · Apache-2.0 GitHub repository of Spearman Rank Correlation (SPEARMAN)

PineForge — Ledger History NA

by pineforge-4pass
1 stars

This strategy plots a smoothed historical price anchor on the price chart by averaging historical closing prices. It enters a long position when price crosses under an entry threshold set below the smoothed anchor. The trade closes when price crosses back abov

Strategy v6 Mean reversionMoving averages
Updated 6 days ago · Apache-2.0 GitHub repository of PineForge — Ledger History NA
99 stars

Square Root Transformation calculates the square root of a selected price or data series in a separate pane. It applies a mathematical square root function to compress scale differences and reduce variance across positive values. The indicator safely handles m

Indicator v6
Updated 4 weeks ago · Apache-2.0 GitHub repository of Square Root Transformation (SQRT)
1 stars

This strategy trades long only on the price chart. It enters when a fast exponential moving average crosses above a slower one and sizes the next order from the last closed trade: the recovery quantity after a negative result and the full quantity otherwise. I

Strategy v6 TrendMoving averages
Updated 6 days ago · Apache-2.0 GitHub repository of PineForge — Ledger Outcome Throttle

Squeeze Momentum

by mihakralj
99 stars

This indicator plots Squeeze Momentum in a separate pane. It compares Bollinger Bands with a Keltner Channel to mark a squeeze when the bands sit inside the channel. Momentum is a linear regression of price relative to a Donchian midline and an SMA, shown as a

Indicator v6 Volatility & bandsOscillators & momentum
Updated 4 weeks ago · Apache-2.0 GitHub repository of Squeeze Momentum
1 stars

The PineForge — Meridian DMI Regime strategy evaluates trend direction and momentum using the Directional Movement Index, Average Directional Index, and an Exponential Moving Average. It enters long trades when +DI crosses above -DI, provided ADX exceeds the d

Strategy v6 TrendOscillators & momentum
Updated 6 days ago · Apache-2.0 GitHub repository of PineForge — Meridian DMI Regime
99 stars

The Standard Deviation (STDDEV) indicator calculates the standard deviation of the input source series over a user-defined period. It employs a circular buffer for O(1) streaming computation, ensuring efficient memory usage. The indicator plots the standard de

Indicator v6 Volatility & bands
Updated 4 weeks ago · Apache-2.0 GitHub repository of Standard Deviation (STDDEV)

PineForge — Mosaic Map Regime

by pineforge-4pass
1 stars

PineForge — Mosaic Map Regime is a trend-following strategy that dynamically scales trading signals using volatility regimes. It calculates an Exponential Moving Average and ATR, using a map to assign risk weights based on whether ATR percentage exceeds an exp

Strategy v6 TrendVolatility & bands
Updated 6 days ago · Apache-2.0 GitHub repository of PineForge — Mosaic Map Regime

Calculates a linear regression trend line and standard deviation bands based on the residuals over a user-defined lookback window. The script plots the central linear regression line along with upper and lower channel boundaries directly on the price chart, fi

Indicator v6 TrendVolatility & bands
Updated 4 weeks ago · Apache-2.0 GitHub repository of Standard Deviation Channel (SDCHANNEL)

PineForge — Orbit MTF Trend

by pineforge-4pass
1 stars

Orbit MTF Trend is a multi-timeframe strategy that plots higher-timeframe and local exponential moving averages on the price chart. It generates long entries on local EMA crossover above the higher EMA and closes positions on the reverse crossover. Risk manage

Strategy v6 TrendMoving averages
Updated 6 days ago · Apache-2.0 GitHub repository of PineForge — Orbit MTF Trend

This indicator calculates the standard error of a linear regression of the chosen source over a user-defined lookback and plots that value as a yellow line in a separate pane. It fits slope and intercept on a circular buffer, then takes the square root of the

Indicator v6
Updated 4 weeks ago · Apache-2.0 GitHub repository of Standard Error of Regression (STDERR)

PineForge — Prism Matrix Vote

by pineforge-4pass
1 stars

The PineForge Prism Matrix Vote strategy plots two EMAs on the price chart and calculates a vote score from four factors: EMA crossover, price above fast EMA, RSI above 52, and ATR relative to close. It enters long positions when the vote score crosses above a

Strategy v6 TrendOscillators & momentum
Updated 6 days ago · Apache-2.0 GitHub repository of PineForge — Prism Matrix Vote
99 stars

The Stochastic Fast (STOCHF) indicator calculates the fast stochastic oscillator, consisting of the raw fast %K line and the smoothed fast %D signal line. %K measures the relative position of the current close within the high-low range calculated over the spec

Indicator v6 Oscillators & momentum
Updated 4 weeks ago · Apache-2.0 GitHub repository of Stochastic Fast (STOCHF)
1 stars

This strategy enters one long position when a fast exponential moving average crosses above a slow one. While the trade is open, it keeps an ATR stop and target under the same exit identifier. For the first revision hold bars those distances stay wide; afterwa

Strategy v6 Moving averagesVolatility & bands
Updated 6 days ago · Apache-2.0 GitHub repository of PineForge — Revision Exit Replacement
99 stars

This indicator plots a Stochastic MACD in a separate pane. It measures the rolling high and low over a lookback, applies fast and slow exponential moving averages to the close, and normalizes each average against that range. The difference, scaled by 100, is t

Indicator v6 Oscillators & momentumMoving averages
Updated 4 weeks ago · Apache-2.0 GitHub repository of Stochastic MACD Oscillator (STMACD)

PineForge — Rivet Calc Fill

by pineforge-4pass
1 stars

This strategy identifies bullish trends using a fast EMA crossing above a slow EMA to enter long positions when no trade is open. Once entered it attaches a stop loss and limit order using ATR multiplied by the input values of 1.7 and 2.2 respectively. The fas

Strategy v6 TrendMoving averages
Updated 6 days ago · Apache-2.0 GitHub repository of PineForge — Rivet Calc Fill
99 stars

This indicator calculates the Stochastic Momentum Index in a separate pane. It finds the highest high and lowest low over a lookback, measures the source relative to the range midpoint, and double-smooths that result into a %K line and a further-smoothed %D si

Indicator v6 Oscillators & momentum
Updated 4 weeks ago · Apache-2.0 GitHub repository of Stochastic Momentum Index (SMI)

PineForge — Sextant CCI HMA

by pineforge-4pass
1 stars

PineForge — Sextant CCI HMA is a trend-following momentum strategy that combines the Commodity Channel Index with a Hull Moving Average filter. The strategy opens long positions when the CCI crosses above a specified entry level, provided the HMA is rising and

Strategy v6 TrendOscillators & momentum
Updated 6 days ago · Apache-2.0 GitHub repository of PineForge — Sextant CCI HMA
99 stars

This indicator calculates the Stochastic Oscillator and plots it in a separate pane. Percent K is the close position within the highest high and lowest low over the K length, scaled from 0 to 100. Percent D is a simple moving average of percent K over the D sm

Indicator v6 Oscillators & momentum
Updated 4 weeks ago · Apache-2.0 GitHub repository of Stochastic Oscillator (STOCH)
1 stars

This overlay strategy keeps a bounded deque of one-bar rate-of-change values and measures how many are positive and their average. It enters one long position of two units when the positive share rises through the minimum share, the average return is positive,

Strategy v6 Oscillators & momentumMoving averages
Updated 6 days ago · Apache-2.0 GitHub repository of PineForge — Spectrum Array Deque
99 stars

This indicator calculates the Stochastic RSI oscillator, which applies the Stochastic formula to a Relative Strength Index series to measure momentum. It computes an RSI value, tracks its rolling high-low range, and calculates smoothed %K and %D lines using cu

Indicator v6 Oscillators & momentum
Updated 4 weeks ago · Apache-2.0 GitHub repository of Stochastic RSI (STOCHRSI)

PineForge — Terrace Pyramid

by pineforge-4pass
1 stars

This strategy plots the Trend EMA and Deep Terrace levels on the price chart to identify rising trends. It signals long pyramid entries in staged terraces when price crosses above the first, second, or third ATR-based levels during an upward trend, with up to

Strategy v6 TrendMoving averages
Updated 6 days ago · Apache-2.0 GitHub repository of PineForge — Terrace Pyramid

Calculates and plots the Stoller Average Range Channel directly on the price chart. It constructs a middle baseline using a Simple Moving Average and projects upper and lower envelope bands based on the Average True Range scaled by a user-defined multiplier. I

Indicator v6 Volatility & bandsMoving averages
Updated 4 weeks ago · Apache-2.0 GitHub repository of Stoller Average Range Channel (STARCHANNEL)
1 stars

This strategy computes the MACD with user-defined fast, slow, and signal lengths, then plots the MACD line, signal line, and histogram in a separate pane. It generates long entries on MACD crossover and short entries on MACD crossunder, but restricts signals t

Strategy v6 Oscillators & momentumSessions & time
Updated 6 days ago · Apache-2.0 GitHub repository of PineForge — Waypoint Weekday MACD
99 stars

This indicator plots the cumulative distribution function of Student's t-distribution in a separate pane. It min-max normalizes the chosen source over a lookback period, maps the result to a t-statistic, and evaluates the CDF through the regularized incomplete

Indicator v6
Updated 4 weeks ago · Apache-2.0 GitHub repository of Student's t-Distribution CDF (TDIST)

Pivot Array Breakout

by pineforge-4pass
1 stars

Pivot Array Breakout is a breakout strategy that tracks dynamic pivot high resistance and pivot low support levels using array buffers. When a new pivot is identified, it is added to a size-limited array while older levels are removed. The strategy enters a lo

Strategy v6 BreakoutSupport & resistance
Updated 6 days ago · Apache-2.0 GitHub repository of Pivot Array Breakout
99 stars

This indicator calculates SuperTrend-style upper and lower bands from the high-low midpoint, offset by an average true range times a multiplier. A rolling buffer keeps the true-range sum over the chosen period, and the bands only tighten until the source close

Indicator v6 TrendVolatility & bands
Updated 4 weeks ago · Apache-2.0 GitHub repository of Super Trend Bands (STBANDS)

Pivot Extension Break

by pineforge-4pass
1 stars

A strategy that detects confirmed swing highs and lows using left and right bar counts, remembers the latest of each, and trades breaks of them. It goes long when the close exceeds the last confirmed pivot high and short when the close falls below the last con

Strategy v6 BreakoutSupport & resistance
Updated 6 days ago · Apache-2.0 GitHub repository of Pivot Extension Break

SuperTrend

by mihakralj
99 stars

This indicator calculates SuperTrend from an ATR-smoothed band around the midpoint of high and low. It plots the active band on the price chart, green in an uptrend and red in a downtrend. Trend flips when close crosses the opposite band and otherwise holds. A

Indicator v6 TrendVolatility & bands
Updated 4 weeks ago · Apache-2.0 GitHub repository of SuperTrend

Pivot Point Levels Break

by pineforge-4pass
1 stars

A minimal strategy using the built-in Traditional pivot point levels. Each bar's levels are computed from the previous bar's high, low and close. It enters long when the close crosses above the first resistance level and short when it crosses below the first s

Strategy v6 Support & resistanceBreakout
Updated 6 days ago · Apache-2.0 GitHub repository of Pivot Point Levels Break
99 stars

Swing High/Low Detection identifies local price peaks and troughs by comparing a central bar against surrounding bars within a user-defined lookback window. Once a pivot point is confirmed after the required lookback period, the indicator updates and plots con

Indicator v6 Support & resistance
Updated 4 weeks ago · Apache-2.0 GitHub repository of Swing High/Low Detection

PVT EMA Cross

by pineforge-4pass
1 stars

A minimal strategy that compares the Price Volume Trend indicator with a 21-period EMA of itself. It enters long when PVT crosses above the average and short when it crosses below, reversing the position each time. It has no adjustable inputs, no stop loss and

Strategy v6 Volume
Updated 6 days ago · Apache-2.0 GitHub repository of PVT EMA Cross

This indicator measures symmetric mean absolute percentage error between a chosen price source and an exponential moving average of that source. Each bar it computes a symmetric percentage error, then averages those errors over the selected lookback with a cir

Indicator v6 Moving averages
Updated 4 weeks ago · Apache-2.0 GitHub repository of Symmetric Mean Absolute %Error (SMAPE)

Range Filter

by pineforge-4pass
1 stars

Calculates an exponential moving average of candle ranges scaled by a multiplier to build an adaptive, stateful trend filter. It updates dynamic upper and lower bands that drift with price action and track market direction. The strategy enters long when the fi

Strategy v6 TrendVolatility & bands
Updated 6 days ago · Apache-2.0 GitHub repository of Range Filter

TD Sequential (TD_SEQ)

by mihakralj
99 stars

TD Sequential calculates Tom DeMark's exhaustion counting system to identify potential trend reversals. It operates in two phases: Phase 1 Setup tracks consecutive price comparisons against historical closes up to a 9-count, while Phase 2 Countdown tracks non-

Indicator v6 Oscillators & momentumTrend
Updated 4 weeks ago · Apache-2.0 GitHub repository of TD Sequential (TD_SEQ)

Regex String Filter

by pineforge-4pass
1 stars

Calculates RSI and MACD indicators to evaluate trade signals parsed dynamically from an input text rule string. It uses regular expression matching to determine whether an RSI threshold rule, a MACD bullish signal line rule, or both must be satisfied. When all

Strategy v6 Oscillators & momentumTrend
Updated 6 days ago · Apache-2.0 GitHub repository of Regex String Filter

Theil's U Statistic

by mihakralj
99 stars

Theil's U Statistic measures forecast accuracy by comparing actual and predicted data series over a rolling length. It calculates a normalized error ratio where zero indicates perfect accuracy and one represents predictive quality equal to a naive forecast. Us

Indicator v6
Updated 4 weeks ago · Apache-2.0 GitHub repository of Theil's U Statistic

RSI 14 Cross 50

by pineforge-4pass
1 stars

A minimal strategy that trades the 14-period RSI crossing the 50 midline. It enters long when RSI crosses up through 50 and short when it crosses down through 50, reversing the position on each opposite signal so only one direction is held at a time. It has no

Strategy v6 Oscillators & momentum
Updated 6 days ago · Apache-2.0 GitHub repository of RSI 14 Cross 50
99 stars

This indicator calculates the third finite difference, or jerk, of a selected data series. By applying binomial expansion coefficients across four consecutive bars, it measures the rate of change of price acceleration. Users can customize the source input seri

Indicator v6 Oscillators & momentum
Updated 4 weeks ago · Apache-2.0 GitHub repository of Third Derivative / Jerk (JERK)

RSI EMA Signal

by pineforge-4pass
1 stars

A strategy that smooths the RSI with an EMA and trades crossovers between the two. It enters long when RSI crosses above its signal line while RSI is below 50, and short when RSI crosses below its signal while RSI is above 50. RSI length and signal length are

Strategy v6 Oscillators & momentum
Updated 6 days ago · Apache-2.0 GitHub repository of RSI EMA Signal
99 stars

This indicator calculates the Triple Exponential Average oscillator as the percentage rate of change of a triple exponential moving average of the chosen source. It plots the resulting series as a single line in a separate pane. The period input sets the smoot

Indicator v6 Oscillators & momentumMoving averages
Updated 4 weeks ago · Apache-2.0 GitHub repository of Triple Exponential Average (TRIX)

RSI MACD Combined State

by pineforge-4pass
1 stars

A minimal strategy that stays long while two conditions hold together: a 14-period RSI above 50 and the MACD line above its signal line, using 12, 26 and 9 settings. When either condition fails, it closes the long position. It never goes short, has no adjustab

Strategy v6 Oscillators & momentum
Updated 6 days ago · Apache-2.0 GitHub repository of RSI MACD Combined State
99 stars

Calculates the True Strength Index oscillator and its exponential moving average signal line using custom double-smoothing on price momentum and absolute momentum. The indicator measures trend strength and direction by normalizing smoothed price variations, pl

Indicator v6 Oscillators & momentum
Updated 4 weeks ago · Apache-2.0 GitHub repository of True Strength Index (TSI)

RSI with Bollinger Bands

by pineforge-4pass
1 stars

Calculates the Relative Strength Index (RSI) and wraps Bollinger Bands directly around the RSI series rather than price. It enters long positions when the RSI drops below its lower band and hooks back upward, and enters short positions when the RSI exceeds the

Strategy v6 Oscillators & momentumVolatility & bands
Updated 6 days ago · Apache-2.0 GitHub repository of RSI with Bollinger Bands

More Pine Script Categories

Browse the whole Pine Library

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.

  1. 1Using this librarySearch, filters, licences and what the badges mean.
  2. 2Add a script to TradingViewCopy, paste into the Pine Editor, save and add to chart.
  3. 3Indicators, strategies and librariesWhat each type does and how to tell them apart.
  4. 4Spot a script that repaintsWhy some signals change after the bar closes.
  5. 5Backtest a strategyStrategy Tester settings that keep results honest.
  6. 6Send alerts to MT4 or MT5From a TradingView alert to an order in MetaTrader.
  7. 7What Pine Script isThe language, what it can and cannot do, and where to start.
  8. 8Write your first indicatorA complete script, line by line, in the Pine Editor.
  9. 9Read a script before you trust itA routine for checking inputs, logic and red flags.
  10. 10Edit a script safelyChange colours and lengths, add a filter or an alert.
  11. 11Pine Script alertsalertcondition(), alert(), placeholders and webhooks.
  12. 12Build a crossover strategyAn EMA cross strategy with an ATR stop, ready to test.

Trade Your Charts With a Regulated Broker

Compare regulated brokers on platforms, spreads, minimum deposit and leverage.

Compare brokers