This Pine Script v5 library extends complex-number handling for other scripts. It treats a complex value as a two-element float array of real and imaginary parts. It exports get_phase, which returns the argument in radians or degrees with quadrant and axis spe
MathComplexOperator is a Pine Script v5 library of utility functions for pseudo complex numbers stored as two-element float arrays of real and imaginary parts. It computes the conjugate by flipping the imaginary sign, adds two complex values, and subtracts one
This Pine Script library exports a liquidity line detection function designed for Smart Money Concepts analysis. It identifies static and dynamic pivot highs and lows over customizable lookback periods, normalizing price differences between consecutive swing p
MathComplexTrignometry is a Pine Script library that provides trigonometric operations for complex numbers represented as float arrays. It implements standard, hyperbolic, arc, and hyperbolic arc trigonometric functions such as sinh, cosh, and tanh. As a devel
This Pine Script v5 library exports frequently used mathematical constants as functions that return fixed numeric values. It includes e, pi, natural and base-10 logarithms of e, 2, 10 and pi, square roots of e, 2, 3 and pi, and related products and inverses su
This Pine Script library provides a collection of atomic and nuclear physical constants based on CODATA reference values. It exports functions returning fundamental physical measurements, including the fine-structure constant, Rydberg constant, Bohr radius, Ha
MathConstantsElectromagnetic is a Pine Script library that provides a collection of predefined electromagnetic constants based on 2007 CODATA reference values. It exports functions for physical parameters including elementary electron charge, magnetic flux qua
This Pine Script v5 library exports named SI scientific prefix factors as constant functions. Each function returns a power of ten, from Yotta through Yocto, covering large prefixes such as Giga and Mega and small prefixes such as Milli, Micro, and Nano. It ca
This Pine Script v6 library exports core data types, enums, and drawing wrappers designed for Smart Money Concepts tools. It defines structured arguments for drawing lines, labels, boxes, and chart points to simplify visual rendering on price charts for concep
This Pine Script library provides exported functions for standard physical and universal mathematical constants. It exports high-precision numerical values including the speed of light, gravitational constant, Planck constant, magnetic permeability, and electr
AuthLib is a Pine Script utility library providing access control and state management structures for technical indicators. It checks callers against a hardcoded array of authorized TradingView usernames before executing operations. The library exports user-de
This library plots order blocks directly on the price chart. It draws lines connecting distal and proximal points of demand order blocks with a middle 50 percent level line and colored zone fills between them. Breaker blocks appear when demand blocks are mitig
MathExtension is a Pine Script v5 library of exported math helpers and does not plot or trade. It supplies base-2 log, floating-point remainder, fractional part, a digit-scaling integral helper, an atan2 approximation in radians, Euclidean hypotenuse, and a ne
AuthLib is a Pine Script v5 library that checks a caller username against a fixed list and, when authorized, prepares drawings for six killzone sessions. It stores boxes, labels, trend lines and price labels in a DrawingData type. For each window it tracks the
This Pine Script v5 library provides a drawing function that renders overlapping supply and demand order blocks directly on the price chart. It calculates proximal, distal, and midpoint mitigation price boundaries when an origin trigger condition is met across
This Pine Script v5 library exports absolute risk statistics for a float sample. It calculates the standard deviation of positive observations, the standard deviation of negative observations, and downside deviation of values below a caller-supplied minimum ac
This Pine Script v5 library exports an order-block refiner for Smart Money Concepts charts. It takes an order-block type, refine flag, refine method, trigger condition and bar index, then measures candle range and body around that bar using a 55-period ATR. Fo
This library exports constants for SMC trading intelligence. It provides market regime status, global news heat scores, bullish and bearish ticker lists, earnings calendars, and per-ticker sentiment maps. These fields support overlay companions in other script
This mathematical utility library implements one-dimensional and two-dimensional Gaussian functions and kernel generators in Pine Script. It calculates standard Gaussian distribution values for single coordinates or coordinate pairs based on a specified sigma
MathGeometryCurvesChaikin is a Pine Script library that implements Chaikin's corner-cutting algorithm to create smooth curved paths from given coordinate arrays. It provides exported functions to calculate single-step curve interpolations and multi-iteration s
This Pine Script v5 library exports named wrappers for basic arithmetic, comparison, and logical operators. It adds, subtracts, multiplies, divides, and returns the remainder of two floats, and tests equality, inequality, and greater or lesser relations, inclu
This library provides Dijkstra's algorithm to compute shortest path distances in a weighted graph. It represents the graph as an adjacency matrix and calculates minimum costs from a start vertex to all others using a greedy approach. The min_distance function
MathSpecialFunctionsGamma is a Pine Script v5 utility library providing mathematical implementations of the Gamma function and its logarithm. It utilizes the Lanczos approximation to evaluate the natural logarithm of the Gamma function with high precision floa
MathSpecialFunctionsLogistic is a Pine Script library that provides mathematical helper functions for logistic calculations. It includes exported functions to compute the standard logistic function and the logit function, which serves as the inverse of the sig
This library provides implementations of standard mathematical test functions used for optimization algorithm evaluation. The Rosenbrock function creates a valley-shaped problem with a global minimum at (1,1), while its multi-dimensional version accepts array
P_syn_library is a Pine Script v6 library that exports two numeric helpers and a small user-defined type. The double function multiplies a float by two, and mid returns the average of two floats. Pair stores two float fields, and the sum method adds those fiel
This library calculates non-parametric kernel density estimation for array observations in Pine Script v5. It generates probability density functions across customizable sample sizes, bandwidths, step counts, and kernel types including Gaussian, uniform, and E
MathStatisticsKernelFunctions is a Pine Script utility library providing statistical kernel weighting functions, including uniform, triangular, Epanechnikov, quartic, triweight, and tricubic kernels. Each function takes a distance relative to the kernel origin
MathTransformsHartley is a Pine Script v5 mathematical library that implements the Discrete Hartley Transform (DHT). It provides functions to calculate naive transforms, fast discrete Hartley transforms (FDHT), and inverse discrete Hartley transforms (IDHT) wi
This Pine Script v5 library exports trigonometric helpers and draws nothing on the chart. It provides a normalized sinc function plus cotangent, cosecant, and secant, with matching inverse functions arc cotangent, arc secant, and arc cosecant. Hyperbolic sine,
MLActivationFunctions is a Pine Script v5 library that provides standard activation functions and their derivatives for neural network models built directly in Pine Script. It exports mathematical functions including binary step, linear, sigmoid, hyperbolic ta
MLLossFunctions is a Pine Script v5 library that exports loss-function methods for machine learning calculations. It computes mean squared error as the average of squared differences between expected and predicted float arrays. It also computes binary cross-en
Probability is a Pine Script v5 library of functions for probability calculations. It multiplies two matrices stored as flat float arrays and raises a square matrix to a power, using helpers intended for Markov-chain state probabilities. It depends on imported
SeasonalDecompositionByMovingAverage is a Pine Script v5 library designed to compute seasonal decomposition elements from array data. Its exported function, seasonal_mean, calculates the mean value for each period within a specified seasonal frequency cycle. I
This Pine Script library provides algorithmic helper functions to perform K-Means clustering calculations. It includes utilities for computing Euclidean distance between two-dimensional coordinates, identifying nearest cluster centers, executing bisection sear
This utility library evaluates mathematical expressions formatted as strings within Pine Script v5. It parses raw input strings, removes whitespace, extracts operators and numeric values, and handles operator precedence. The code includes support for transform
Vector2Operations is a Pine Script v5 utility library that stores two-dimensional vectors as two-element float arrays and exposes helpers to read and write their components. It computes the fractional part of a number, an approximate atan2 angle in radians fro
A Pine Script v5 library whose functions build arrays of values that meet a condition. One function collects the latest values where a condition is true since a reset condition, optionally keeping only a set number of values, and another keeps values within a
A Pine Script v5 library for working with intrabar data from a lower timeframe. It chooses a lower timeframe for the chart based on a precision setting, either by how many chart bars should be covered or by the approximate number of intrabars per chart bar, be
A Pine Script v5 library that tracks compounded monthly return percentages in an array, capped at a maximum number of periods, so that ratio calculations can be built on them. It has an overload for excess returns over a benchmark. Settings include the returns
A Pine Script v5 library of helper functions for strategy scripts. It converts a percentage of the average entry price into ticks, price levels or currency amounts, which helps when placing percentage-based stop loss and limit exits. Inputs set a percent stop
A Pine Script v5 library of helper functions for strategy scripts. It converts a percentage of the entry price into ticks, a price level or a currency amount, converts between prices and ticks, and reports the profit of the open position as a percentage if it
A Pine Script v5 library of string helpers that add to the built-in string functions. It extracts the text to the left or right of the nth occurrence of a separator, with versions for simple and series strings. The file includes example code that shows the cod
Provides a collection of technical analysis calculation functions for use across Pine scripts. It exports implementations for various indicators and mathematical formulas, including oscillators like the Awesome Oscillator, Aroon, and Schaff Trend Cycle, moving
A Pine Script v5 library of time helper functions. It formats a timestamp into time, date and weekday strings, and measures how many seconds a condition has stayed true, with an optional reset on each new bar. Settings in the demo code cover tick counts, hold
A Pine Script v5 library whose functions return values from the bars currently visible on the chart. It can test whether a bar is visible or is the first or last visible bar, and return the highest high, lowest low, their bar indexes and times, and the opening
Pine library of functions that average values only when a condition is met. Functions cover a cumulative average when a condition is true, an average over the last chosen number of occurrences, an average over a chosen number of bars back, an average since a c
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.