Pine Library · 4,643 open-source scripts

Free Pine Script v5 Scripts (page 35)

Scripts written for Pine Script version 5. They still run in TradingView as they are, and the Pine Editor can convert them to version 6.

Pine scripts4,643
Code shown here2,378open licence
Updated in a year2,687
No repaint flag4,051

Pine Script v5: Indicators, Strategies and Libraries

1 stars

This strategy trades flips of the Parabolic SAR. It enters long when price closes above the SAR after being at or below it on the prior bar, and short on the opposite flip. Each trade has an ATR-based stop loss and take profit set by separate multipliers. Acce

Strategy v5 Trend
Updated 1 year ago · None stated GitHub repository of Parabolic SAR Strategy

A large overlay indicator that merges several tools from the same repository: forex session boxes with kill zones, a market structure oscillator, zero-lag trend levels, a volumatic VIDYA average, an adaptive Money Flow Index, an ADX histogram, a dual-speed TSI

Indicator v5 Sessions & timeSMC / ICT / price action
1 stars

This strategy detects divergences in MACD, MACD histogram, and RSI indicators to generate buy and sell signals on the price chart. It supports long and short positions with customizable take-profit and stop-loss percentages. The main settings allow switching b

Strategy v5 DivergenceOscillators & momentum Repaints
Updated 1 year ago · None stated GitHub repository of Divergence for Many [Dimkud]

Hammers & Shooting Stars

by fiji-solutions
1 stars

This indicator identifies single-bar candlestick patterns, specifically hammer and shooting star formations. It uses a configurable Fibonacci threshold to determine if the candle body rests in the upper or lower proportion of the total price range. An Average

Indicator v5 Candlestick patternsVolatility & bands
Updated 2 years ago · None stated GitHub repository of Hammers & Shooting Stars

Donchian Trend

by JoeTonDev
1 stars

A trend-following strategy that goes long when price closes above the prior 20-bar high while a fast EMA is above a slow EMA, and short on a close below the prior 20-bar low when the fast EMA is below. Positions close on a 10-bar opposite extreme, and an ATR-b

Strategy v5 BreakoutTrend
Updated 2 years ago · None stated GitHub repository of Donchian Trend

algo-trade-indian-v1

by akash-yellgetti
1 stars

A strategy-type script for the price chart that plots the high, low and midpoint of the first part of each session, using end hour and minute inputs, and marks those bars. It adds pivot-based support and resistance lines with left and right bar counts, labels

Strategy v5 Sessions & timeSupport & resistance
Updated 2 years ago · None stated GitHub repository of algo-trade-indian-v1
1 stars

This strategy plots the built-in Supertrend line in green or red on the price chart. When the Supertrend value steps up it enters a long position, and when it steps down it enters a short position, so it stays in the market and reverses on each change. Each or

Strategy v5 TrendVolatility & bands
Updated 2 years ago · MPL-2.0 GitHub repository of Hello World, Supertrend
1 stars

This strategy follows Supertrend, with a 10-period ATR and a multiplier of three by default. It goes long when price crosses above the Supertrend line and short when price crosses below, and also closes on the opposite cross. In addition, each trade has a perc

Strategy v5 TrendVolatility & bands
Updated 2 years ago · None stated GitHub repository of Supertrend + Percentage Target and Stop

ATR/Close Ratio

by JohnsonHsiao
1 stars

This indicator calculates the ratio of the Average True Range (ATR) to the closing price, expressed as a percentage. It plots the resulting percentage line in a separate pane along with a customizable horizontal line representing a volatility threshold. Trader

Indicator v5 Volatility & bands
Updated 3 years ago · None stated GitHub repository of ATR/Close Ratio

Hotch Session

by rajatjpatel
1 stars

A session overlay that shades the chart background for the Asian, European and American trading sessions, plus an optional custom session. Start and end hours and minutes are editable for each, using UTC, and individual weekdays can be switched on or off, with

Indicator v5 Sessions & time
Updated 4 years ago · None stated GitHub repository of Hotch Session
1 stars

Relative Volatility Index is a Pine v5 strategy that calculates a relative volatility index and draws Bollinger Bands, with a basis line and fill, in a separate pane with reference lines at 20 and 80. The index line itself is commented out of the plots. It goe

Strategy v5 Volatility & bandsMean reversion Archived
Updated 4 years ago · None stated GitHub repository of Relative Volatility Index
1 stars

The High Low MA Band Indicator calculates moving averages separately on high and low prices to create a dynamic price channel overlaid directly on the chart. Users can select between Exponential, Weighted, Volume-Weighted, or Hull Moving Average calculation ty

Indicator v5 TrendMoving averages
Updated 4 years ago · None stated GitHub repository of High Low MA Band Indicator

ICT Equal Highs and Lows

by ArunKBhaskar
575 stars

This overlay indicator finds pivot highs and lows on the price chart and compares the last two highs and the last two lows. When the percentage difference between a pair is below the Equal HL threshold, it treats them as equal levels and draws a box. Left and

Indicator v5 SMC / ICT / price actionSupport & resistance
Updated 1 year ago · MPL-2.0 GitHub repository of ICT Equal Highs and Lows

MTF RSI

by Alorse
330 stars

This strategy enters long when price is above a long moving average and the RSI falls below an oversold level. It closes the long position when the RSI rises above an overbought level or price drops below the moving average. The RSI length, oversold and overbo

Strategy v5 Oscillators & momentumMoving averages
Updated 2 months ago · None stated GitHub repository of MTF RSI
318 stars

This indicator plots three moving averages on the price chart alongside colored fills between the lines to visualize trend structure. Internally, it calculates a Stochastic RSI oscillator to detect oversold reversals. When the Stochastic %K line rises above 10

Indicator v5 Moving averagesOscillators & momentum
Updated 2 months ago · MIT GitHub repository of TVT 3X Scale In Out

ArrayOperationsInt

by ricardosantos79
261 stars

This Pine Script v5 library provides basic arithmetic operations for integer arrays. It exports helper functions to add, subtract, multiply, and divide two integer arrays element by element. When the secondary array is shorter than the primary array, operation

Library v5
Updated 4 years ago · None stated GitHub repository of ArrayOperationsInt

AI Trend

by dearvn
257 stars

AI Trend is an indicator that plots pivot points, trend lines, and support and resistance levels directly on the price chart. It marks high and low pivots based on user-defined length, draws trend lines that check for violations at specified points, and identi

Indicator v5 TrendSupport & resistance
Updated 7 weeks ago · None stated GitHub repository of AI Trend

MACD-V

by harryguiacorn
220 stars

MACD-V is a volatility-normalized momentum indicator based on research by Alex Spiroglou. It calculates the standard MACD histogram and normalizes it by dividing by the Average True Range (ATR). Plotted in a separate pane as a colored histogram, it includes us

Indicator v5 Oscillators & momentumVolatility & bands
Updated 1 year ago · None stated GitHub repository of MACD-V

This indicator implements an artificial neural network using a single-layer perceptron model trained from scratch directly in Pine Script. It processes price features combined with a custom directional movement index across a rolling sample window to generate

Indicator v5 AI / machine learningTrend
Updated 1 year ago · None stated GitHub repository of Machine Learning: Perceptron-Based Strategy 5 (v.2)

This overlay strategy backtests a dollar-cost-averaging bot on the price chart. It opens a long base order when the selected oscillator signals: MACD line cross, MFI or RSI below a threshold, or Stochastic RSI K crossing above D. Further orders average down by

Strategy v5 Oscillators & momentumMean reversion Repaints
Updated 2 years ago · GPL-3.0 GitHub repository of 3Commas Bot DCA Backtester & Signals FREE

This overlay strategy combines a Nadaraya-Watson envelope, an RSI calculation, and an ATR stop-loss finder. With repainting off, it plots yellow upper and lower bands from a Gaussian endpoint estimate; with repainting on, it redraws the envelope on the last ba

Strategy v5 Oscillators & momentumVolatility & bands Repaints
Updated 3 years ago · MIT GitHub repository of Nadaraya-Watson Envelope, RSI, and ATR Stop Loss Finder

Moon Dev GEX Arrows

by moondevonyt
92 stars

This overlay indicator plots option strike walls and an optional session VWAP on the price chart for SPY or ES. It spaces major strikes by the selected instrument, draws a set number of strikes on each side, and marks wall-trap and sweep events after a cooldow

Indicator v5 Support & resistanceSessions & time
Updated 2 months ago · Custom licence GitHub repository of Moon Dev GEX Arrows

CCI DC

by be-thomas
65 stars

This indicator plots the Commodity Channel Index in a separate pane and surrounds it with a Donchian channel whose lookback length changes with volatility. It measures volatility as a ratio of short and long ATR values, then ranks that ratio and shortens or le

Indicator v5 Oscillators & momentumVolatility & bands
Updated 6 days ago · GPL-3.0 GitHub repository of CCI DC

Take Profits & Stop Losses

by PythonForForex
64 stars

This educational strategy demonstrates moving average crossovers filtered by RSI momentum, incorporating ATR-based risk management. It calculates a 10-period SMA, a 30-period SMA, a 14-period RSI, and a 14-period ATR. Long entries trigger when the fast SMA cro

Strategy v5 Moving averagesOscillators & momentum
Updated 4 years ago · None stated GitHub repository of Take Profits & Stop Losses
56 stars

This indicator marks forex trading sessions and opening ranges on the price chart. It can draw Sydney, Tokyo, Frankfurt, London, and New York session boxes or five- and fifteen-minute opening ranges, plus an optional opening channel and a day-open range. Day r

Indicator v5 Sessions & timeSupport & resistance Repaints
Updated 2 months ago · None stated GitHub repository of Day Trading Booster by DGT

ZigZag

by milocaetano
48 stars

This Pine Script indicator identifies market structure pivots and plots a ZigZag line on the price chart. It calculates high and low pivot points using built-in pivot functions based on a configurable pivot strength input. When a pivot high or low is confirmed

Indicator v5 Support & resistanceTrend
Updated 3 days ago · MIT GitHub repository of ZigZag
43 stars

This indicator evaluates market momentum and risk by calculating trend metrics and volatility stats, displaying them in an on-chart table pane. It measures short-term and long-term trend strength via two MACD configurations built on three customizable EMA leng

Indicator v5 TrendVolatility & bands
Updated 1 year ago · None stated GitHub repository of Trend Strength & Volatility

This indicator plots a relative strength index in a separate pane. It calculates RSI from the average of the previous ten opens rather than the current bar, so that source does not change during the live candle. A moving average of the RSI is plotted and can b

Indicator v5 Oscillators & momentumMoving averages
Updated 2 years ago · None stated GitHub repository of No Repaint - Relative Strength Index

Arnaud Legoux Moving Average

by TWODS-CAPITAL
37 stars

This indicator plots the Arnaud Legoux Moving Average of the closing price on the price chart. It uses TradingView's built-in ALMA calculation with a user-set window size, offset, and sigma. Those three inputs change how much history the average includes and h

Indicator v5 Moving averages
Updated 3 years ago · MIT GitHub repository of Arnaud Legoux Moving Average
29 stars

This overlay indicator builds trend ranges from a Donchian midpoint. It takes the highest high and lowest low over a user length, averages them, and holds that basis until the midpoint changes. When the basis updates, it sets a range from the close standard de

Indicator v5 TrendVolatility & bands
Updated 11 months ago · Custom licence GitHub repository of Donchian Trend Ranges [AlgoAlpha]
24 stars

This indicator plots Bollinger Bands on the price chart alongside a baseline moving average to identify trend-aligned swing setups. It calculates trend bias by comparing the Bollinger Bands basis to a customizable moving average, such as a 200 EMA. Trade signa

Indicator v5 Volatility & bandsOscillators & momentum
Updated 4 years ago · MPL-2.0 GitHub repository of Bollinger Band Swing
20 stars

This indicator plots John Ehlers' simple decycler on the price chart. It applies a high-pass filter to the chosen source, subtracts that component from the source, and draws the remaining low-frequency line. The line is green when the decycler rises for two co

Indicator v5 Trend
Updated 1 year ago · None stated GitHub repository of John F. Ehlers - Simple Decycler
16 stars

This indicator plots RSI, stochastic, and a scaled MACD together in a separate pane. It calculates RSI and stochastic %K and %D, then shifts the stochastic values upward by 100 so they sit above the RSI scale. The MACD line is normalized against its running mi

Indicator v5 Oscillators & momentum
Updated 2 years ago · None stated GitHub repository of RSI, Stochastic, and MACD

Crossing EMAs D

by ruckard
13 stars

Crossing EMAs D is a moving average crossover strategy designed to automate trade execution through Zignaly webhook and email integration. It detects simple moving average crossovers (14-period and 28-period) and formats detailed payload alert messages for cry

Strategy v5 Moving averagesTrend
Updated 1 year ago · None stated GitHub repository of Crossing EMAs D
12 stars

This indicator draws custom higher-timeframe period separators and opening price horizontal lines directly on the price chart. Users can select the target timeframe, such as monthly, to display vertical separator lines alongside a horizontal line marking the h

Indicator v5 Support & resistanceSessions & time Repaints
Updated 1 year ago · None stated GitHub repository of My Period Separator All Timeframes

Portfolio Backtester

by f-cksociety
11 stars

The script is a Pine Script v5 indicator that emulates strategy backtesting directly on the price chart. It evaluates modular entry strategies, trade directions, entry stop-loss types such as ATR multiples or fixed percentages, and a wide variety of trade filt

Indicator v5 TrendOscillators & momentum
Updated 4 years ago · MPL-2.0 GitHub repository of Portfolio Backtester

Ichimoku Cloud - Eterna

by EternaHybridExchange
9 stars

This strategy calculates standard Ichimoku Cloud components, including the conversion line, base line, and displaced leading spans. It opens long positions when price resides above a bullish cloud and the conversion line crosses above the base line. Short entr

Strategy v5 Trend
Updated 7 months ago · MIT GitHub repository of Ichimoku Cloud - Eterna

Order Block Strategy

by muammeryldrm42
7 stars

This strategy identifies bullish and bearish order blocks using an average true range impulse filter and plots corresponding boxes on the price chart. It enters positions on price retests of the order block zones, optionally filtered by an exponential moving a

Strategy v5 SMC / ICT / price actionTrend
Updated 3 months ago · MIT GitHub repository of Order Block Strategy
7 stars

This indicator recolors candlestick bodies directly on the main price chart based on relative trading volume. It calculates volume relative to a simple moving average (SMA) over a user-defined length. Up bars and down bars are assigned one of six distinct colo

Indicator v5 Volume
Updated 4 months ago · None stated GitHub repository of Candle Color by Volume

EMA 9/26/52/200

by SynergOps
7 stars

EMA 9/26/52/200 calculates four exponential moving averages based on bar closing prices using fixed periods of 9, 26, 52, and 200. It plots all four lines directly on the main price chart in distinct yellow, purple, blue, and red colors to help identify short-

Indicator v5 TrendMoving averages
Updated 1 year ago · MPL-2.0 GitHub repository of EMA 9/26/52/200

This strategy generates trading signals based on crossovers between daily session VWAP and a 4-hour 90-period Exponential Moving Average (EMA). When VWAP crosses above the 4-hour EMA, the strategy closes open short positions and enters a long trade with full e

Strategy v5 TrendMoving averages Repaints
Updated 3 years ago · MIT GitHub repository of 4H Bullish Buy 4H Bearish Sell Session

FX Market Sessions

by itmakesyousick
7 stars

This indicator draws up to three named forex sessions on the price chart, defaulting to London, New York and Tokyo in a chosen timezone. Each session can show a shaded history box, dashed borders, optional Fibonacci levels and an opening range. Users set sessi

Indicator v5 Sessions & timeSupport & resistance
Updated 3 years ago · None stated GitHub repository of FX Market Sessions

MACD

by trsdn
6 stars

This indicator implements a standard Moving Average Convergence Divergence oscillator plotted in a separate pane. It calculates fast and slow exponential moving averages of the closing price, derives the MACD line from their difference, and smooths it to creat

Indicator v5 Oscillators & momentumMoving averages
Updated 7 days ago · MIT GitHub repository of MACD
6 stars

This strategy example builds TradersPost webhook JSON messages and plots them as colored labels on the price chart. At fixed clock hours it shows a long with a trailing-stop percent, an add, a cancel, an exit, a short with a trailing-stop price, a flatten, and

Strategy v5
Updated 1 year ago · None stated GitHub repository of WebhookMessage Test Strategy

RSI Threshold

by latentwill
4 stars

This strategy calculates the Relative Strength Index of the close and is configured for a separate pane. It opens a long position when RSI is below the oversold level and a short position when RSI is above the overbought level. Position size defaults to ten pe

Strategy v5 Oscillators & momentumMean reversion
Updated 8 days ago · None stated GitHub repository of RSI Threshold
4 stars

This strategy overlays directly on the price chart to identify pullback buying opportunities during established bullish moves. It checks whether price gained by a specified percentage over an earlier window and subsequently pulled back by a minimum threshold o

Strategy v5 TrendMean reversion
Updated 5 months ago · None stated GitHub repository of Buy the Dip in an Uptrend

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