Library "DailyDeviation" Helps in determining the relative deviation from the open of the day compared to the high or low values. hlcDeltaArrays(daysPrior, maxDeviation, spec, res) Retuns a set of arrays representing the daily deviation of price for a given number of days. Parameters: daysPrior : Number of days back to get the close from. ...
Library "Volatility" Functions for determining if volatility (true range) is within or exceeds normal. The "True Range" (ta.tr) is used for measuring volatility. Values are normalized by the volume adjusted weighted moving average (VAWMA) to be more like percent moves than price. current(len) Returns the current price adjusted volatitlity...
Library "DataCleaner" Functions for acquiring outlier levels and acquiring a cleaned version of a series. outlierLevel(src, len, level) Gets the (standard deviation) outlier level for a given series. Parameters: src : The series to average and add a multiple of the standard deviation to. len : The The number of bars to measure. level : The...
Library "bench" A simple banchmark library to analyse script performance and bottlenecks. Very useful if you are developing an overly complex application in Pine Script, or trying to optimise a library / function / algorithm... Supports artificial looping benchmarks (of fast functions) Supports integrated linear benchmarks (of expensive scripts) One...
Library "HurstExponent" Library to calculate Hurst Exponent refactored from Hurst Exponent - Detrended Fluctuation Analysis demean(src) Calculates a series subtracted from the series mean. Parameters: src : The series used to calculate the difference from the mean (e.g. log returns). Returns: The series subtracted from the series mean ...
Library "Moments" Based on Moments (Mean,Variance,Skewness,Kurtosis) . Rewritten for Pinescript v5. logReturns(src) Calculates log returns of a series (e.g log percentage change) Parameters: src : Source to use for the returns calculation (e.g. close). Returns: Log percentage returns of a series mean(src, length) Calculates the mean of a...
Library "pNRTR" Provides functions for calculating Nick Rypock Trailing Reverse (NRTR) trend values with higher precision offsets for both low, and high points rather than the standard single offset. pnrtr(float low_offset = 0.2, float high_offset = 0.2, float value = close) low_offset Offset used for nrtr low_point calculations. Default is 0.2. ...
Library "cache" A simple cache library to store key value pairs. Fed up of injecting and returning so many values all the time? Want to separate your code and keep it clean? Need to make an expensive calculation and use the results in numerous places? Want to throttle calculations or persist random values across bars or ticks? Then you've come to...
Library "FFTLibrary" contains a function for performing Fast Fourier Transform (FFT) along with a few helper functions. In general, FFT is defined for complex inputs and outputs. The real and imaginary parts of formally complex data are treated as separate arrays (denoted as x and y). For real-valued data, the array of imaginary parts should be filled with...
Library "FunctionProbabilityDistributionSampling" Methods for probability distribution sampling selection. sample(probabilities) Computes a random selected index from a probability distribution. Parameters: probabilities : float array, probabilities of sample. Returns: int.
Library "FunctionElementsInArray" Methods to count number of elements in arrays count_float(sample, value) Counts the number of elements equal to provided value in array. Parameters: sample : float array, sample data to process. value : float value to check for equality. Returns: int. count_int(sample, value) Counts the number of elements...
Library "LinearRegressionLibrary" contains functions for fitting a regression line to the time series by means of different models, as well as functions for estimating the accuracy of the fit. Linear regression algorithms: RepeatedMedian(y, n, lastBar) applies repeated median regression (robust linear regression algorithm) to the input time series...
Library "FunctionCompoundInterest" Method for compound interest. simple_compound(principal, rate, duration) Computes compound interest for given duration. Parameters: principal : float, the principal or starting value. rate : float, the rate of interest. duration : float, the period of growth. Returns: float. variable_compound(principal,...
This is a public library that include the functions explained below. The libraries are considered public domain code and permission is not required from the author if you reuse these functions in your open-source scripts
Library "FunctionDecisionTree" Method to generate decision tree based on weights. decision_tree(weights, depth) Method to generate decision tree based on weights. Parameters: weights : float array, weights for decision consideration. depth : int, depth of the tree. Returns: int array
Library "FunctionForecastLinear" Method for linear Forecast, same as found in excel and other sheet packages. forecast(sample_x, sample_y, target_x) linear forecast method. Parameters: sample_x : float array, sample data X value. sample_y : float array, sample data Y value. target_x : float, target X to get Y forecast value. Returns: float
Library "FunctionBoxCoxTransform" Methods to compute the Box-Cox Transformer. regular(sample, lambda) Regular transform. Parameters: sample : float array, sample data values. lambda : float, scaling factor. Returns: float array. inverse(sample, lambda) Regular transform. Parameters: sample : float array, sample data values. ...
Library "FunctionBestFitFrequency" TODO: add library description here array_moving_average(sample, length, ommit_initial, fillna) Moving Average values for selected data. Parameters: sample : float array, sample data values. length : int, length to smooth the data. ommit_initial : bool, default=true, ommit values at the start of the data under the...