Pine Library · 4,367 open-source scripts

Free Pine Script v6 Scripts (page 87)

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

1 stars

This strategy identifies volatility compression and corridor breakouts on the price chart. It detects squeeze conditions where Bollinger Bands compress inside Keltner Channels, combined with Donchian Channel range boundaries. Long trades trigger on an upward s

Strategy v6 Volatility & bandsBreakout
Updated 2 months ago · None stated GitHub repository of Zzc Corridor Sovereign v6
99 stars

The Mean Relative Absolute Error indicator measures forecast accuracy by comparing an actual price series against a predicted price series. For each bar, it divides the absolute difference between actual and predicted values by the absolute actual value, then

Indicator v6
Updated 4 weeks ago · Apache-2.0 GitHub repository of Mean Relative Absolute Error

PF probe wunder-scalper-probe-02-alert-message-templates is a strategy that generates long and short signals using a fast EMA of 5 crossing above a slow EMA of 13 on the price chart. It places fixed-size entries of 1 share on each crossover signal and emits al

Strategy v6 Moving averagesTrend
Updated 6 days ago · Apache-2.0 GitHub repository of PF probe wunder-scalper-probe-02-alert-message-templates

ZZC Market Structure Sovereign v6 is a trend-following strategy that combines directional pivot tracking with Keltner-style volatility corridors. It calculates pivot highs and lows alongside an EMA baseline bounded by ATR corridors. A long entry is triggered w

Strategy v6 TrendVolatility & bands
Updated 2 months ago · None stated GitHub repository of ZZC Market Structure Sovereign v6
99 stars

The Mean Squared Error indicator calculates the mean of squared differences between a source series and its EMA, averaged via a rolling buffer acting as SMA. This error metric plots as a filled red area on a separate pane, while the EMA overlays as a yellow li

Indicator v6 Volatility & bandsMean reversion
Updated 4 weeks ago · Apache-2.0 GitHub repository of Mean Squared Error (MSE)
1 stars

Calculates fast and slow Exponential Moving Averages (EMAs) to identify trend shifts on the price chart. When the fast EMA crosses above the slow EMA, any open short position is closed before opening a long trade. When the fast EMA crosses below, any open long

Strategy v6 TrendMoving averages
Updated 6 days ago · Apache-2.0 GitHub repository of PF Probe Wunder-Scalper-Probe-Integration

This indicator calculates the Mean Squared Logarithmic Error (MSLE) between a selected price source and its exponential moving average over a specified lookback period. It evaluates prediction error by computing the squared difference of natural logarithms, sm

Indicator v6 Moving averages
Updated 4 weeks ago · Apache-2.0 GitHub repository of Mean Squared Logarithmic Error (MSLE)
1 stars

A test strategy from a reference corpus that fills orders at the close of the signal bar. It goes long when a 9-period EMA crosses above a 21-period EMA while RSI is below 70, and closes the long when the EMAs cross back down. One unit is traded, with no stop

Strategy v6 Moving averagesOscillators & momentum
Updated 6 days ago · Apache-2.0 GitHub repository of PF Process Orders 02 On Close True

Median

by mihakralj
99 stars

Calculates the rolling statistical median of a chosen price or indicator series over a specified lookback period. For each bar, the script gathers valid data points across the window into an array, sorts them, and determines the midpoint value, averaging the t

Indicator v6 Moving averages
Updated 4 weeks ago · Apache-2.0 GitHub repository of Median
1 stars

This strategy serves as a validation probe to test default order execution timing where orders are processed on the open of the following bar. It implements a simple long-only system using a 9-period and 21-period exponential moving average crossover filtered

Strategy v6 Moving averagesTrend
Updated 6 days ago · Apache-2.0 GitHub repository of PF process-orders 01 - on_close=false

Median Absolute Error

by mihakralj
99 stars

This indicator calculates the median absolute error between an actual series and a predicted series over a rolling window. On each bar it takes the absolute difference of the two sources, then applies a median of that length. It plots the result as a line in a

Indicator v6
Updated 4 weeks ago · Apache-2.0 GitHub repository of Median Absolute Error
1 stars

This strategy tests deferred position flips under pyramiding. It enters long at market when a 9-period EMA crosses above a 21-period EMA and RSI stays below 70, and it queues short stop entries when RSI crosses under 50, with the stop placed a quarter of ATR b

Strategy v6 Oscillators & momentumMoving averages
Updated 6 days ago · Apache-2.0 GitHub repository of PF Pyramid carry 01 - deferred flip
99 stars

The Median Absolute Percentage Error (MdAPE) indicator calculates and plots the rolling median of percentage forecast errors between an actual price series and a predicted series over a user-defined window. For each bar, it computes the absolute percentage err

Indicator v6
Updated 4 weeks ago · Apache-2.0 GitHub repository of Median Absolute Percentage Error
1 stars

This Pine Script strategy evaluates fast and slow exponential moving average crossovers gated by an RSI boundary to enter long positions. It utilizes fixed cash position sizing and permits up to three pyramided entries, converting cash to fractional contract a

Strategy v6 Moving averagesTrend
Updated 6 days ago · Apache-2.0 GitHub repository of PF Pyramid Carry 02 - Cash Fractional

MEDPRICE: Median Price

by mihakralj
99 stars

This indicator calculates the median price of each bar as the average of the high and the low, matching the TA-Lib MEDPRICE definition and the built-in HL2 source. It plots that single series on the price chart as an orange line of width two. There are no user

Indicator v6
Updated 4 weeks ago · Apache-2.0 GitHub repository of MEDPRICE: Median Price
1 stars

PF session-dst probe 01 - NY spring forward is a validation strategy designed to test session time calculation and Daylight Saving Time transition behavior. It evaluates the New York equity session hours from 09:30 to 16:00 in the America/New_York time zone. T

Strategy v6 Sessions & time
Updated 6 days ago · Apache-2.0 GitHub repository of PF session-dst probe 01 - NY spring forward
99 stars

This indicator plots the rolling midpoint of the close as an overlay on the price chart. For each bar it takes the highest and lowest close over a user-set period and draws their average, matching the TA-Lib midpoint definition of the center of that range. The

Indicator v6 Support & resistance
Updated 4 weeks ago · Apache-2.0 GitHub repository of MIDPOINT: Rolling Midpoint
1 stars

This Pine Script strategy calculates the accumulation/distribution line with ta.accdist and its 21-period EMA. It plots these in a separate pane. The strategy issues long entries on ta.crossover of the accumulation/distribution line above its EMA and short ent

Strategy v6 VolumeMoving averages
Updated 6 days ago · Apache-2.0 GitHub repository of PF TA isolate - accdist EMA(21) cross
99 stars

The Midpoint Price over Period indicator calculates the center of the highest high and lowest low price range over a user-defined lookback period. It averages the maximum high and minimum low values across the chosen window, providing a TA-Lib compatible basel

Indicator v6 Support & resistance
Updated 4 weeks ago · Apache-2.0 GitHub repository of MIDPRICE: Midpoint Price over Period
1 stars

This validation strategy calculates a 9-period Chande Momentum Oscillator (CMO) on the closing price to isolate zero-line crossing behavior. It enters a long position when the CMO crosses above zero and opens a short position when it crosses below zero, revers

Strategy v6 Oscillators & momentum
Updated 6 days ago · Apache-2.0 GitHub repository of PF TA isolate - CMO(9) zero cross
99 stars

This overlay indicator plots a channel of the highest high and the lowest low over a rolling lookback. It updates both extremes with a monotonic deque so each bar is handled in amortized constant time, then draws the upper and lower lines on the price chart an

Indicator v6 Support & resistanceVolatility & bands
Updated 4 weeks ago · Apache-2.0 GitHub repository of Min-Max Channel (MMCHANNEL)
1 stars

This strategy calculates the Ehlers Center of Gravity oscillator of length 10 on close and an exponential moving average of length 5 of that oscillator. It enters long when the oscillator crosses above the signal and enters short when it crosses below. Positio

Strategy v6 Oscillators & momentum
Updated 6 days ago · Apache-2.0 GitHub repository of PF TA isolate - COG(10) signal cross
99 stars

Min-Max Normalization rescales a price series or input source into a bounded range between 0 and 1 using rolling minimum and maximum values over a designated lookback period. It plots the normalized output as a line indicator in a separate chart pane. Users ca

Indicator v6
Updated 4 weeks ago · Apache-2.0 GitHub repository of Min-Max Normalization (NORMALIZE)
1 stars

This strategy calculates a 14-period Money Flow Index using typical price and volume data. It triggers a long entry when the indicator crosses above the oversold threshold of 20 and a short entry when it crosses below the overbought threshold of 80. Displayed

Strategy v6 Oscillators & momentumVolume
Updated 6 days ago · Apache-2.0 GitHub repository of PF TA isolate - MFI(14) bands 20/80
99 stars

This indicator calculates and plots the Minus Directional Indicator (-DI) in a separate pane to measure downward price movement. It computes negative directional movement and true range using Wilder's smoothing with warmup compensation, ensuring stable values

Indicator v6 TrendOscillators & momentum
Updated 4 weeks ago · Apache-2.0 GitHub repository of Minus Directional Indicator (-DI)
1 stars

This strategy plots the Positive Volume Index and Negative Volume Index in a separate pane and compares each with its own exponential moving average of length 255. It opens a long when PVI crosses above its EMA and opens a short when NVI crosses below its EMA.

Strategy v6 VolumeMoving averages
Updated 6 days ago · Apache-2.0 GitHub repository of PF TA isolate - NVI/PVI vs EMA255 cross
99 stars

Calculates and plots the Minus Directional Movement (-DM) component of J. Welles Wilder's directional movement system. It measures downward price momentum by comparing the current low to the previous low and applying Wilder's RMA smoothing with warmup compensa

Indicator v6 TrendOscillators & momentum
Updated 4 weeks ago · Apache-2.0 GitHub repository of Minus Directional Movement (-DM)
1 stars

This strategy plots the Rank Correlation Index of close over a fixed 14-bar window in a separate pane. It enters long when RCI crosses above zero and short when RCI crosses below zero, reversing with a fixed quantity of one. There is no stop loss, take profit,

Strategy v6 Oscillators & momentum
Updated 6 days ago · Apache-2.0 GitHub repository of PF TA isolate - RCI(14) zero cross

Mode

by mihakralj
99 stars

Mode calculates the most frequent value of a chosen source series over a lookback period and plots that value in a separate pane. The source defaults to close and the period defaults to 14. On each bar it counts non-missing values inside the available window,

Indicator v6
Updated 4 weeks ago · Apache-2.0 GitHub repository of Mode

PF TA isolate - WPR(14) bands

by pineforge-4pass
1 stars

This strategy plots the Williams %R oscillator in a separate pane and generates long entries when it crosses above -80 while generating short entries on crossunder below -20. It uses fixed position sizing of one unit per signal with no stop loss and allows pyr

Strategy v6 Oscillators & momentum
Updated 6 days ago · Apache-2.0 GitHub repository of PF TA isolate - WPR(14) bands

Modular Filter (MODF)

by mihakralj
99 stars

Modular Filter (MODF) calculates and plots an adaptive dual-path smoothing filter on the main price chart. Based on work by alexgrover, it computes upper and lower EMA bands that snap to price extremes and maintain a bullish or bearish state. The beta paramete

Indicator v6 TrendMoving averages
Updated 4 weeks ago · Apache-2.0 GitHub repository of Modular Filter (MODF)
1 stars

This strategy calculates a 14-period RSI of close and places mean-reversion entries at fixed outer bands. It enters long when RSI crosses up through 30 and enters short when RSI crosses down through 70. Position size is a fixed quantity of one, with commission

Strategy v6 Oscillators & momentumMean reversion
Updated 6 days ago · Apache-2.0 GitHub repository of PF TA isolate 02 - RSI(14) bands 30/70

Momentum (MOM)

by mihakralj
99 stars

This indicator calculates momentum as the difference between the selected source and the same source a set number of bars earlier, measuring the rate of price change. It plots a single MOM line in a separate pane. Length sets the lookback, with a minimum of on

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

This strategy tests the 55-period Hull Moving Average (HMA) calculation. It enters a long position when the closing price crosses above the HMA(55) line and enters a short position when the closing price crosses below it. The script operates directly on the pr

Strategy v6 Moving averagesTrend
Updated 6 days ago · Apache-2.0 GitHub repository of PF TA Isolate 04 - Close x HMA(55)

The MACD indicator calculates the difference between two exponential moving averages with fast and slow periods to identify momentum shifts in the market. It plots the MACD line, signal line, and histogram bars in a separate pane below the price chart. The his

Indicator v6 Oscillators & momentumMoving averages
Updated 4 weeks ago · Apache-2.0 GitHub repository of Moving Average Convergence Divergence (MACD)
1 stars

This validation strategy tests continuous-state entry and exit logic using a standard 14-period Relative Strength Index (RSI). It opens a long position whenever RSI is above 50 and closes the position whenever RSI drops to or below 50. The script operates in a

Strategy v6 Oscillators & momentum
Updated 6 days ago · Apache-2.0 GitHub repository of PF TA isolate 06 - RSI(14) > 50 Continuous
1 stars

This validation strategy evaluates a continuous-state MACD trend condition rather than a crossover event trigger. It calculates standard MACD line, signal line, and histogram values on the closing price using 12, 26, and 9 periods. The strategy enters a long p

Strategy v6 Oscillators & momentum
Updated 6 days ago · Apache-2.0 GitHub repository of PF TA Isolate 07 - MACD > Sig Continuous
99 stars

Normal Distribution CDF (NORMDIST) calculates the cumulative distribution function for a normalized price series in a separate indicator pane. It standardizes price values using a rolling mean and standard deviation over a customizable lookback window, then sc

Indicator v6 Mean reversion
Updated 4 weeks ago · Apache-2.0 GitHub repository of Normal Distribution CDF (NORMDIST)

This Pine Script strategy calculates a standard 14-period Relative Strength Index (RSI) to generate simple momentum-based trading signals. It executes a long entry of one fixed unit when the RSI rises above 55 while flat. Open positions close entirely once the

Strategy v6 Oscillators & momentum
Updated 6 days ago · Apache-2.0 GitHub repository of PF TA isolate 09 - RSI>60 entry, RSI<45 exit

Notch Filter (NOTCH)

by mihakralj
99 stars

Calculates and plots a second-order Infinite Impulse Response (IIR) notch filter directly on the price chart. Based on the RBJ Audio EQ Cookbook design, the filter attenuates a specific cyclic frequency component from the input series while preserving other ma

Indicator v6 TrendMoving averages
Updated 4 weeks ago · Apache-2.0 GitHub repository of Notch Filter (NOTCH)
1 stars

PF TA Isolate 10 - Typed-Matrix UTC is a Pine Script v6 strategy designed for engine parity validation. It populates a 24-by-7 boolean matrix tracking high-RSI hours and days using an explicit UTC timezone specification. The matrix is transposed twice to check

Strategy v6 Oscillators & momentum
Updated 6 days ago · Apache-2.0 GitHub repository of PF TA Isolate 10 - Typed-Matrix UTC

NW - Nadaraya-Watson Kernel Regression is an indicator that applies a non-repainting Gaussian kernel regression filter to smooth price data. For each bar, it calculates a normalized weighted average of historical values using a Gaussian weighting function, ope

Indicator v6 Moving averagesTrend
Updated 4 weeks ago · Apache-2.0 GitHub repository of NW - Nadaraya-Watson Kernel Regression
1 stars

This validation strategy calculates a 14-period Relative Strength Index (RSI) and maintains a persistent 24x7 boolean matrix tracking whether RSI crossed above 60 for specific hour and day combinations. Long positions are entered when at least six cells in the

Strategy v6 Oscillators & momentum
Updated 6 days ago · Apache-2.0 GitHub repository of PF TA Isolate 11 - Mask Only No Transpose

One Euro Filter

by mihakralj
99 stars

This indicator plots an adaptive One Euro low-pass filter of a chosen price source on the chart. When movement is slow it uses a lower cutoff for heavier smoothing; when the smoothed derivative rises it raises the cutoff to reduce lag. Minimum cutoff, the spee

Indicator v6
Updated 4 weeks ago · Apache-2.0 GitHub repository of One Euro Filter
1 stars

A test strategy from a reference corpus that evaluates RSI, a MACD histogram and a Bollinger middle line on 1-hour data requested from a 15-minute chart, with lookahead off. It goes long one unit when hourly RSI is above 55, the hourly histogram is positive an

Strategy v6 Oscillators & momentumTrend
Updated 6 days ago · Apache-2.0 GitHub repository of PF TA Recompute Probe 01 MTF RSI MACD BB

Parabolic SAR

by mihakralj
99 stars

Parabolic SAR plots dots on the price chart to indicate trend direction and potential reversals. It calculates a trailing stop level that starts at the extreme price of the prior bar and adjusts using an acceleration factor that increases with each new extreme

Indicator v6 TrendSupport & resistance
Updated 4 weeks ago · Apache-2.0 GitHub repository of Parabolic SAR

PF TV golden 40 - bracket TP/SL

by pineforge-4pass
1 stars

This validation strategy executes on the price chart to test bracket order execution. It enters a single long position at 00:15 whenever flat, using a fixed quantity of one contract. Upon entry, it immediately places a bracket exit order with a 0.4% take-profi

Strategy v6 Sessions & time
Updated 6 days ago · Apache-2.0 GitHub repository of PF TV golden 40 - bracket TP/SL

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