Library "Signal_Data_2021_09_09__2021_11_18" Functions to support my timing signals system import_start_time(harmonic) get the start time for each harmonic signal Parameters: harmonic : is an integer identifying the harmonic Returns: the starting timestamp of the harmonic data import_signal(index, harmonic) access point for pre-processed data...
Library "FunctionArrayMaxSubKadanesAlgorithm" Implements Kadane's maximum sum sub array algorithm. size(samples) Kadanes algorithm. Parameters: samples : float array, sample data values. Returns: float. indices(samples) Kadane's algorithm with indices. Parameters: samples : float array, sample data values. Returns: tuple with format .
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 "ArrayMultipleDimensionPrototype" A prototype library for Multiple Dimensional array methods index_md_to_1d() new_float(dimensions, initial_size) Creates a variable size multiple dimension array. Parameters: dimensions : int array, dimensions of array. initial_size : float, default=na, initial value of the array. Returns: float...
Library "FunctionArrayReduce" A limited method to reduce a array using a mathematical formula. float_(formula, samples, arguments, initial_value) Method to reduce a array using a mathematical formula. Parameters: formula : string, the mathematical formula, accepts some default name codes (index, output, previous, current, integer index of arguments...
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 "amibroker" This library consists of functions from amibroker that doesn't exist on tradingview pinescript. The example of these are the ExRem and Flip. In the example below, I used ExRem to remove the excessive buy and sell signals. Meanwhile, I used the Flip to highlight the bg color when there is an open position. exrem(series1, series2) Removes...
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,...
Library "FunctionSMCMC" Methods to implement Markov Chain Monte Carlo Simulation (MCMC) markov_chain(weights, actions, target_path, position, last_value) a basic implementation of the markov chain algorithm Parameters: weights : float array, weights of the Markov Chain. actions : float array, actions of the Markov Chain. target_path : float...
Library "FunctionGeometricLineDrawings" array_delete_all_lines(lines) deletes all lines in array. Parameters: lines : line array, array with line objects to delete. Returns: void. triangle(sample_x, sample_y, xloc, extend, color, style, width) Draw a Triangle with 3 vector2D(x, y) coordinates. Parameters: sample_x : int array, triangle...
This is same as existing zigzag library with respect to functionality. But, there is a small update with respect to how arrays are used internally. This also leads to issues with backward compatibility. Hence I decided to make this as new library instead of updating the older one. Below are the major changes: Earlier version uses array.unshift for adding...
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 "FunctionPolynomialRegression" TODO: polyreg(sample_x, sample_y) Method to return a polynomial regression channel using (X,Y) sample points. Parameters: sample_x : float array, sample data X points. sample_y : float array, sample data Y points. Returns: tuple with: _predictions: Array with adjusted Y values. _max_dev: Max...
Library "FunctionLinearRegression" Method for Linear Regression using array sample points. linreg(sample_x, sample_y) Performs Linear Regression over the provided sample points. Parameters: sample_x : float array, sample points X value. sample_y : float array, sample points Y value. Returns: tuple with: _predictions: Array with adjusted Y...