A library draws nothing on its own. It exports functions, such as a moving average variant, a table helper or a date tool, that your own scripts load with an import statement.
To import a library in TradingView it has to be published there, so the GitHub copy is mainly for reading and learning how the functions work. Check the licence before you reuse the code in your own scripts.
9 of these 198 scripts are marked Repaints, or read higher-timeframe data with lookahead on.
Before You Use One
Read which functions it exports and what each one returns.
AIActivationFunctionsBipolarSigmoid is a Pine Script library that provides mathematical implementations of the bipolar sigmoid activation function and its derivatives for machine learning algorithms. It calculates bipolar sigmoid values bounded between -1 and
This Pine Script v5 library provides helpers for approximating price and reducing noise. The exported DFT3 function computes a three-point discrete Fourier transform from the current close and the two previous closes, using a direction parameter that scales th
This utility library formats automated trading alert messages into structured JSON strings for external execution. It provides functions to construct text payloads for opening limit orders, cancelling existing limit orders, and closing all active positions wit
Color is a Pine Script utility library designed for advanced color manipulation and comparison within scripts. It provides helper methods to compare two color instances across RGB and transparency channels, calculate relative color luminosity, and determine hi
This library provides functions for rolling statistical computations and probability calibration in trading applications. It maintains rolling buffers with running sum recalculation to efficiently handle large datasets. Additional tools compute 3-way posterior
A Pine library that exports one core function returning many values for use by other scripts. It computes ATR, optional session and displacement filters, a signed volume pressure measure with z-score, a session-resetting cumulative volume proxy, and linear reg
This library exports a function that returns a dynamic trailing stop price based on Average True Range. For longs it subtracts an ATR multiple from the close and ratchets the level upward, resetting the stop when price closes below the previous level. For shor
TAIndicators is a Pine Script library providing helper functions for technical analysis calculations. It features flexible moving average functions supporting SMA, EMA, SMMA, WMA, and VWMA options, along with secondary smoothing methods and Bollinger Band calc
AIActivationFunctionsSigmoid is a utility library for Pine Script v5 that provides mathematical calculations for the sigmoid activation function, commonly used in artificial intelligence and machine learning algorithms. The library exports functions to evaluat
KernelFunctions is a Pine Script v5 library that exports kernel weight functions for Nadaraya-Watson style estimation. It calculates a Rational Quadratic kernel, a Gaussian kernel based on a radial basis function, and a periodic kernel that models repeating be
This library exports a Band type and functions that build a simple-moving-average basis with upper and lower envelopes from standard deviation. It classifies a source as above, below, or inside those envelopes, measures band width, and scales an imported z-sco
HLevel is a Pine Script v5 utility library designed to manage horizontal price levels for cryptocurrency charts. It defines custom types for pivots and levels, along with methods to initialize, add, track, and expire price levels based on pivot high and pivot
Quant is a Pine Script utility library providing custom functions for quantitative analysis. It includes an exported function to calculate the percentage change between consecutive values of any float series. Additionally, it offers a function to calculate mar
This library calculates ZigZag pivots and draws connecting lines on the price chart. It changes direction when price moves beyond a percentage deviation after a set pivot depth, then stores each pivot with optional labels for reversal price, cumulative volume,
EMA Lib is a Pine Script v5 library that provides a custom exponential moving average calculation function. The library exports a single function that takes a period length parameter and computes an exponential moving average on close prices. To initialize the
This library determines opening gap severity by calculating the standard deviation of overnight gaps. It exports functions for today's gap value as open minus previous close, gap percent change, and normal daily standard deviation of the gap using a rolling wi
Skipp Labels is a Pine Script v6 helper library designed to assist with label creation and memory management on price charts. It exports functions for string safety and buffer control. The safe label text function truncates long strings to a maximum of 120 cha
A Pine v6 library template showing how to structure exported code. It defines a Pivot type holding bar index, price and direction, a higher timeframe request helper that reads the previous closed bar, a method that returns a confirmed swing pivot only after th
CommonSignals is a Pine Script utility library providing standardized signal generation functions for technical analysis scripts. It normalizes trade directions across diverse indicators into consistent integer values: 1 for buy, 0 for neutral, and -1 for sell
The SFA FlowLiquidity library computes structural flow and liquidity events from price data. It detects sweep ups and downs with associated scores, identifies liquidity levels, and applies session and regime filters. Persistent arrays track liquidity prices, b
This library calculates position size for trading strategies based on a percentage of equity to risk and the distance to the stop loss price. The function takes risk percentage, entry price, and stop loss price as inputs and returns the quantity of contracts o
CandleAnalysis is a Pine Script library providing exportable helper functions for detailed candlestick analysis in custom scripts. It evaluates whether a specified bar is bullish, bearish, or break-even, and computes metrics including body size, top wick size,
A small Pine v5 library of helper functions for the author's Woodwind Playbook script. One function writes a text tag on the chart just above the recent ten-bar high, using a label. Another builds a number format string that limits displayed price precision to
A Pine library that exports a scoring function for price against two simple moving averages, with periods of 9 and 20. Depending on the candle colour and where the close sits relative to each average, it adds or subtracts weighted values and returns the total
This Pine Script v5 library implements a threshold activation function for neural-network style calculations. The exported function returns 1.0 when the input is greater than or equal to zero and 0.0 otherwise. Two derivative exports, derivate and derivate2, a
Chart Patterns is a Pine Script v6 library designed to scan for and render technical chart patterns directly on the price chart. It defines custom user-defined types to configure scanning parameters, such as Zigzag pivot offsets, error ratios, flat ratios, and
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
Commonlib is a Pine Script v6 library of bar-geometry helpers that draws nothing by itself. It measures the longer wick as a share of the high-low range, signed when the lower wick is longer, and the candle body as a signed share of that range. It combines tho
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
This library manages TradingView chart labels through configuration templates, change-aware updaters, and a named registry. It lets callers set position, text, colors, style, size, and tooltips with a fluent interface, then apply only properties that differ fr
Skipp Math is a utility library for Pine Script v6 containing constants and functions for probability calculations, statistical analysis, and data normalization. It provides clamping utilities, logit and sigmoid transformations, range position computation, 95%
This library from the SFA framework detects structural flow points using break of structure (BOS) and change of character (CHOCH) events. It calculates impulse origins by comparing close prices against ATR-based high and low extremes, filtered by volume percen
This Pine Script v6 utility library provides a reusable function to filter backtest date ranges. It evaluates whether the current bar timestamp falls between a specified start time and end time, returning a boolean value. Although configured as an overlay on t
MarketAnalysis is a helper library for Pine Script developers that provides modular functions to compute Fibonacci price levels. It offers calculations for both bullish and bearish Fibonacci retracements using low and high price points. Additionally, it calcul
A Pine library that exports three functions, bullish, bearish and getTrend, which judge market direction on the current symbol and timeframe. Each call takes three switches to include a Stochastic RSI cross, a MACD line versus signal check and a comparison of
A Pine v5 library that supplies auxiliary calculation functions for the author's Woodwind Playbook script. The visible part includes a function that works out the gains after a position is scaled down, taking entry, exit, quantity, remaining quantity and direc
A Pine library that exports condition checks for long and short setups, selected by a position type string. The simple moving average check uses a 10-bar average and requires the close, and for longs the low, to sit on one side of it with a matching candle col
This Pine Script library provides utility functions for script development and backtest reporting. It includes a function to display debug text labels on the chart, a rounding utility to round floating-point values to a specified number of decimal places, and
This Pine Script v5 library provides a LOESS local weighted smoothing routine for paired x and y sample arrays. It builds a local neighborhood around each sample, applies a tricubic distance weight, and fits a weighted local regression. A separate polynomial w
MLExtensions is a Pine Script library providing utility and mathematical helper functions for machine learning indicators, specifically optimized for approximate nearest neighbors classification in Lorentzian space. It includes functions to normalize series de
This script serves as a minimal utility library written in Pine Script v6. It provides an exported helper function that calculates the sum of two numeric arguments. As a reusable code library, it produces no visual plots, charts, or trading signals, and it con
This Pine Script v5 library walks historical price, volume, time and amount series until a requested number of hours is covered, stopping at 4999 bars. TimeAligned returns the bar count, net and absolute price changes, net and absolute log-price changes, volum
This library exports utilities for calculating moving averages rather than drawing them on a chart. It provides a volume-adjusted weighted moving average that combines volume weighting with triangular recent-bar emphasis, and a coefficient moving average that
Skipp Scoring is a Pine Script v6 utility library that provides quantitative scoring functions for technical analysis scripts. It calculates normalized market state scores ranging between -1 and +1, evaluating trend strength, discrete regimes (bullish, bearish
The library detects price gap inefficiencies using structural flow analytics. It identifies new bullish and bearish gaps with their top and bottom levels, tracks mitigation status, and checks flow alignment between price and CVD trends. It applies regime detec
Objects is a Pine Script utility library providing dynamic type detection functions for script development and debugging. It exports overloaded getType methods for fundamental Pine Script data types and visual drawing objects, including integers, floats, boole
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
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
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.