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...
Library "MathSpecialFunctionsDiscreteFourierTransform" Method for Complex Discrete Fourier Transform (DFT). dft(inputs, inverse) Complex Discrete Fourier Transform (DFT). Parameters: inputs : float array, pseudo complex array of paired values . inverse : bool, invert the transformation. Returns: float array, pseudo complex array of paired values .
Library "Bursa_Sector" : List of stocks classified by sector in Bursa Malaysia (As of Oct 2021) getSector() This function will get the sector of current stock that listed in Bursa Malaysia
Library "CreateAndShowZigzag" Functions in this library creates/updates zigzag array and shows the zigzag getZigzag(zigzag, prd, max_array_size) calculates zigzag using period Parameters: zigzag : is the float array for the zigzag (should be defined like "var zigzag = array.new_float(0)"). each zigzag points contains 2 element: 1. price level of the zz...
Library "MathComplexEvaluate" TODO: add library description here is_op(char) Check if char is a operator. Parameters: char : string, 1 character string. Returns: bool. operator(op, left, right) operation between left and right values. Parameters: op : string, operator string character. left : float, left value of operation. right : float,...
Library "MathComplexTrignometry" Methods for complex number trignometry operations. sinh(complex) Hyperbolic Sine of complex number. Parameters: complex : float array, complex number. Returns: float array. cosh(complex) Hyperbolic cosine of complex number. Parameters: complex : float array, complex number. Returns: float array. tanh(complex)...
Library "MathComplexExtension" A set of utility functions to handle complex numbers. get_phase(complex_number, in_radians) The phase value of complex number complex_number. Parameters: complex_number : float array, pseudo complex number in the form of a array . in_radians : boolean, value for the type of angle value, default=true, options=(true:...