Pine Library · 4,643 open-source scripts

Free Pine Script v5 Scripts (page 20)

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

13 stars

This strategy generates entry signals using pivot points and uses custom Curie moving average closing lines for exiting positions. It features risk management components including percentage-based stop loss, take profit, trailing stops, and break-even levels,

Strategy v5 TrendMoving averages
Updated 1 year ago · None stated GitHub repository of BitLa PivotPoints A002
12 stars

This strategy enters long when a fast EMA crosses above a slow EMA and RSI, ADX, and volume all clear their thresholds. It sizes the order from a percentage of equity and an ATR stop distance, then sets a partial profit target at a multiple of that risk. After

Strategy v5 TrendMoving averages
Updated 4 months ago · None stated GitHub repository of BTC 4H Institutional Trend

我的腳本

by blockplusim
12 stars

This script plots two simple moving averages (SMA) directly on the main price chart. It calculates a short-term 7-period SMA and a medium-term 20-period SMA based on bar closing prices. The 7-period SMA is displayed in red, while the 20-period SMA is rendered

Indicator v5 Moving averagesTrend
Updated 1 year ago · None stated GitHub repository of 我的腳本

BTE Acc AO

by f-cksociety
11 stars

This script provides an indicator-based backtesting engine framework built around Accelerator Oscillator and Awesome Oscillator logic. It simulates strategy executions directly on the price chart by plotting entry levels, take profit targets, trade markers, an

Indicator v5 Oscillators & momentumSupport & resistance
Updated 4 years ago · MPL-2.0 GitHub repository of BTE Acc AO

CCI Strategy - Eterna MCP

by EternaHybridExchange
9 stars

This strategy plots the Commodity Channel Index in a separate pane and enters long or short only when flat. A long opens when CCI crosses above the oversold level or rebounds from an extreme oversold zone; a short uses the opposite conditions. It closes the po

Strategy v5 Oscillators & momentum
Updated 7 months ago · MIT GitHub repository of CCI Strategy - Eterna MCP
9 stars

Volume SuperTrend AI (Expo) combines SuperTrend trend filtering with a k-nearest neighbors machine learning classification algorithm. It computes a SuperTrend using customizable moving average types, including simple, exponential, weighted, smoothed, or volume

Indicator v5 TrendAI / machine learning
Updated 3 years ago · None stated GitHub repository of Volume SuperTrend AI (Expo)
8 stars

This indicator detects contrarian inflection points and potential market reversals by combining sentiment, volume, and price action metrics directly on the price chart. It evaluates overbought and oversold conditions with the RSI and Stochastic oscillators, hi

Indicator v5 Oscillators & momentumVolatility & bands
Updated 7 weeks ago · None stated GitHub repository of GCR Inflection Point Scanner
8 stars

The Triple EMA vs 55 EMA strategy plots three exponential moving averages (lengths 8, 13, 21), a 65-period exponential moving average, a 200-period simple moving average, and Hull moving averages of length 55 on high and low. It fills the area between the HMA

Strategy v5 Moving averagesTrend
Updated 4 years ago · None stated GitHub repository of Triple EMA vs 55 EMA

Chandelier Exit

by muammeryldrm42
7 stars

This strategy implements trend-following breakout entries based on the Chandelier Exit calculation filtered by an exponential moving average. It calculates trailing stop bands using the highest high or lowest low over a lookback period adjusted by an Average T

Strategy v5 TrendVolatility & bands
Updated 3 months ago · MIT GitHub repository of Chandelier Exit

This strategy plots a 90-period simple moving average from the daily and four-hour charts plus a daily session VWAP on the price chart. It enters long when VWAP is above the daily average and the four-hour VWAP crosses above its average, and short in the oppos

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

FX Market Sessions

by itmakesyousick
7 stars

This indicator plots colored session boxes on the price chart representing London, New York and Tokyo market sessions. Users customize session start and end times, colors, and labels for each session while enabling options for historical display, oscillator mo

Indicator v5 Sessions & time
Updated 3 years ago · None stated GitHub repository of FX Market Sessions
6 stars

This indicator plots a weekly simple moving average and a weekly exponential moving average on the price chart and shades the area between them. It requests weekly values of the close-based averages so the band stays aligned with the weekly timeframe even on l

Indicator v5 TrendMoving averages
Updated 7 days ago · MIT GitHub repository of Bull Market Support Band

This indicator measures the distribution of bar-to-bar close returns over a rolling window and presents the results in a table on the price chart. It calculates annualized mean return and volatility, a simple Sharpe ratio, a 95 percent value-at-risk percentile

Indicator v5 Volatility & bandsScreeners & dashboards
6 stars

The TradersPost Example MOMO Strategy is a trend-following trading strategy that generates buy and sell signals based on exponential moving average (EMA) crossovers. It calculates a fast EMA and a slow EMA on the chart timeframe while plotting multi-timeframe

Strategy v5 TrendMoving averages
Updated 1 year ago · None stated GitHub repository of TradersPost Example MOMO Strategy

MultiVolatility

by wanjo-tech
6 stars

MultiVolatility calculates and compares multiple annualized volatility metrics within a separate pane. It computes a traditional 20-day historical volatility using log returns on daily data scaled by 252 days, which displays on daily charts. Additionally, it i

Indicator v5 Volatility & bands
Updated 2 years ago · None stated GitHub repository of MultiVolatility

Edge 60

by subos2008
6 stars

This strategy executes a classic Donchian-style breakout system on the price chart. It calculates the highest high and lowest low over a user-defined lookback period offset by one bar. A long position is opened when the price breaks above the previous period h

Strategy v5 BreakoutTrend
Updated 2 years ago · Custom licence GitHub repository of Edge 60

RSI mean reversion

by broomva
5 stars

This strategy plots the relative strength index in a separate pane and trades mean reversion. It enters long when RSI crosses above the oversold level and enters short when RSI crosses below the overbought level. Opposite signals reverse the position. Size def

Strategy v5 Oscillators & momentumMean reversion
Updated 2 days ago · MIT GitHub repository of RSI mean reversion

This strategy fits a binary logistic regression classification model bar by bar on the price chart to generate long trading signals. It computes model weights via iterative gradient descent based on user-defined learning rates, lookback windows, and normalizat

Strategy v5 AI / machine learningTrend Repaints
Updated 2 weeks ago · MIT GitHub repository of Xsodus Logistic Long Regression Strategy
5 stars

This strategy trades long when an M15 bar's low comes within a tolerance of the prior week's low and the bar closes above that level. It places a fixed point stop below entry and a take-profit at a chosen R-multiple of that stop. Entries are limited to a UTC s

Strategy v5 Support & resistanceSessions & time
Updated 5 months ago · MIT GitHub repository of WKL v2 — Prior Week Low Retest (Locked Spec)
5 stars

Calculates daily classical pivot points from the previous day's high, low, and close to identify intraday reversal setups within a defined trading session. Long signals fire when price comes within a configurable tick proximity to S1 and prints a bullish recla

Indicator v5 Support & resistanceMean reversion
Updated 5 months ago · Custom licence GitHub repository of Path C — Pivot-Point Bounce (Demo)

Scalping PullBack Tool R1.1

by Ahmed-GoCode
5 stars

This indicator plots a Price Action Channel (PAC) based on high, low, and close moving averages alongside fast, medium, and slow trend EMAs directly on the price chart. It detects regular and Bill Williams fractals to track market structure and identifies pull

Indicator v5 TrendMoving averages
Updated 1 year ago · None stated GitHub repository of Scalping PullBack Tool R1.1

ATR Based Stoploss

by rubystar0512
5 stars

ATR Based Stoploss is an overlay indicator that calculates dynamic stop loss and take profit bands around a central simple moving average. It uses standard Average True Range or an ATR Surge Average derived from volatility spikes to offset profit and loss boun

Indicator v5 Volatility & bandsMoving averages
Updated 2 years ago · None stated GitHub repository of ATR Based Stoploss

Hedge Exit Algo

by jerryinyang
5 stars

Hedge Exit Algo provides position sizing and lot calculations for forex and precious metals hedging strategies. It evaluates pip values, currency conversion rates, and profit targets relative to account balance. The script defines custom lot sizing routines al

Indicator v5 Moving averages Repaints
Updated 2 years ago · None stated GitHub repository of Hedge Exit Algo

Standard Lib

by vitahoang
5 stars

Standard Lib is a utility Pine Script library designed to assist developers with chart debugging and dynamic text display. It exports a print function that creates and updates a single text label on the price chart. The label automatically positions itself at

Library v5
Updated 3 years ago · None stated GitHub repository of Standard Lib
4 stars

This strategy translates Python backtesting logic into Pine Script for intraday momentum trading. It calculates forced Heikin-Ashi candles and 1-minute moving averages to evaluate market trends and assign a signal strength score from 0 to 10. Entries execute w

Strategy v5 TrendMoving averages
Updated 3 days ago · None stated GitHub repository of Xiao Tang System v2 Strategy

EMA Cross + RSI Filter

by latentwill
4 stars

This strategy plots on the price chart and trades EMA crossovers filtered by RSI. It enters long when the fast EMA crosses above the slow EMA and RSI is above the minimum threshold. A cross below closes the long and opens a short without an RSI filter. Each en

Strategy v5 TrendMoving averages
Updated 8 days ago · None stated GitHub repository of EMA Cross + RSI Filter

MACD 4H Rhythm

by LePotoRico2105
4 stars

MACD 4H Rhythm is a TradingView strategy that trades the price chart on a four-hour forex rhythm. It goes long when the MACD histogram crosses above zero while a 21-period EMA is above a 50-period EMA, and short on the opposite histogram turn in a bearish EMA

Strategy v5 Oscillators & momentumMoving averages
Updated 7 months ago · MIT GitHub repository of MACD 4H Rhythm

Daily Loss Limit [Lab]

by mitchell-917
4 stars

This strategy example enforces a daily loss limit. It detects a new trading day, stores starting equity, and tracks the day's highest and lowest equity. Trading permission depends on whether the loss from the day's starting equity stays inside a percentage of

Strategy v5 Moving averagesSessions & time
Updated 11 months ago · Custom licence GitHub repository of Daily Loss Limit [Lab]

Harami Cross - Bullish

by Hugs-4-Bugs
4 stars

Harami Cross - Bullish detects the two-candle bullish Harami Cross pattern directly on the main price chart. It identifies a long red candle during a downtrend followed by a Doji candle contained entirely within the previous candle's body. Users can refine tre

Indicator v5 Candlestick patternsTrend
Updated 1 year ago · None stated GitHub repository of Harami Cross - Bullish

All Candlestick Patterns

by ShabbirHasan1
4 stars

All Candlestick Patterns identifies and highlights classical Japanese candlestick patterns directly on the price chart. It determines underlying market trends using configurable moving averages, including a 50-period SMA, a dual SMA 50/200 setup, or no trend f

Indicator v5 Candlestick patternsMoving averages
Updated 1 year ago · Custom licence GitHub repository of All Candlestick Patterns

ATCA-HO

by Kalumur
4 stars

ATCA-HO is an overlay indicator that plots six Exponential Moving Averages alongside a Simple Moving Average on the price chart. It generates visual buy and sell shape labels whenever the fastest 5-period EMA crosses above or below the 22-period EMA. Additiona

Indicator v5 TrendMoving averages
Updated 2 years ago · None stated GitHub repository of ATCA-HO

VolTargeting

by Robot-Wealth
4 stars

VolTargeting is a Pine Script v5 library of functions for volatility-based position sizing. ewmaVol estimates exponentially weighted annualised volatility from squared simple returns and scales it by the square root of 365 days for crypto or 252 days otherwise

Library v5 Volatility & bands
Updated 2 years ago · None stated GitHub repository of VolTargeting

Combines multiple analytical tools onto a single price chart overlay to consolidate screen space. It plots three customizable exponential moving averages, three-bar imbalance and opening gap boxes, a horizontal volume profile with point of control, and smart m

Indicator v5 SMC / ICT / price actionMoving averages Repaints
4 stars

This strategy implements a dollar-cost averaging (DCA) trading framework using Volume-Weighted Moving Average (VWMA) values and price percentage changes. It enters an initial base order and places up to a configurable number of safety orders as price declines

Strategy v5 Moving averagesScreeners & dashboards
Updated 2 years ago · None stated GitHub repository of SRP Strategy [ZCrypto]

Drift [DojiEmoji]

by kevinhhl
4 stars

This indicator calculates market drift using logarithmic returns adjusted for variance over a configurable lookback period. It measures underlying directional movement and plots a continuous line in a separate pane, colored blue when drift is positive and red

Indicator v5 TrendVolatility & bands
Updated 3 years ago · None stated GitHub repository of Drift [DojiEmoji]

Bollinger Band Strategy

by might-tree
4 stars

The Bollinger Band Strategy is a mean-reversion trading strategy designed to trade bounces off Bollinger Bands. It enters long positions when the closing price crosses above the lower band and short positions when it crosses below the upper band. Upon entry, t

Strategy v5 Volatility & bandsMean reversion
Updated 3 years ago · None stated GitHub repository of Bollinger Band Strategy
4 stars

Snag - Swing Trade Long Term calculates 13-period, 48-period, and 200-period Weighted Moving Averages to evaluate market direction for long-term swing trading. The indicator monitors price crossovers across each moving average to identify initial trend shifts,

Indicator v5 TrendMoving averages
Updated 4 years ago · None stated GitHub repository of Snag - Swing Trade Long Term

One EMA Strategy

by aofwittawat
4 stars

This strategy plots one exponential moving average of the close on the price chart and colors it and the background by whether price is above or below that average. It flips from short to long when the close crosses above the EMA and from long to short when th

Strategy v5 TrendMoving averages
Updated 4 years ago · None stated GitHub repository of One EMA Strategy
3 stars

ATD+ST+T3 Kripto Tarama is a chart overlay indicator and cryptocurrency scanner that combines AlphaTrend, SuperTrend, and T3 moving average signals. It plots trend lines, fills, and buy/sell label shapes directly on the main price chart while providing configu

Indicator v5 TrendVolatility & bands
Updated 2 days ago · None stated GitHub repository of ATD+ST+T3 Kripto Tarama

Average True Range

by jash-git
3 stars

This indicator calculates the average true range by taking a simple moving average of the true range over a user-set length. It plots that value as a thick line in a separate pane. The only setting changes the smoothing length, which defaults to 13 bars. The p

Indicator v5 Volatility & bands
Updated 4 weeks ago · None stated GitHub repository of Average True Range
3 stars

This long-only strategy draws on the price chart. It uses MACD with the 21- and 52-period exponential moving averages. While the signal line is above zero and the faster average is above the slower one, it marks a histogram pullback and enters long on a bullis

Strategy v5 Oscillators & momentumMoving averages
Updated 7 weeks ago · None stated GitHub repository of MACD能量柱跳空策略

AI Trading Bot - 19 Modules

by thanhcong1211
3 stars

This strategy overlays trend, momentum, and simplified Smart Money Concepts (SMC) directly on the price chart. It evaluates market conditions using triple EMAs (20, 50, 200), MACD crossovers, RSI levels, and volume moving averages alongside simplified order bl

Strategy v5 SMC / ICT / price actionTrend
Updated 3 months ago · None stated GitHub repository of AI Trading Bot - 19 Modules

Mc War v2

by tuanmcwar
3 stars

Calculates and plots Smart Money Concepts market structure elements directly on the main price chart. It highlights bullish and bearish market structure breaks, including Change of Character and Break of Structure, alongside swing points and strong or weak lev

Indicator v5 SMC / ICT / price actionSupport & resistance
Updated 4 months ago · None stated GitHub repository of Mc War v2

MTF Confluence Dashboard

by WiseManAlgo
3 stars

This indicator displays a multi-timeframe confluence dashboard and signal arrows directly on the main price chart. It evaluates trend and momentum across five configurable timeframes for up to three symbols using an exponential moving average and the relative

Indicator v5 Screeners & dashboardsTrend
Updated 4 months ago · None stated GitHub repository of MTF Confluence Dashboard

% Chg Lines

by g-moe
3 stars

This indicator plots the previous daily close and five pairs of price levels set a chosen percentage above and below that close. It draws the previous close and each offset as cross-style plots on the price chart, fills the span to the outermost upper and lowe

Indicator v5 Support & resistance
Updated 5 months ago · None stated GitHub repository of % Chg Lines

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