Library "ArrayExt" Array extensions get(a, idx) Get element from the array at index, or na if index not found Parameters: a : The array idx : The array index to get Returns: The array item if exists or na get(a, idx) Get element from the array at index, or na if index not found Parameters: a : The array idx : The array index to...
Library "FunctionMinkowskiDistance" Method for Minkowski Distance, The Minkowski distance or Minkowski metric is a metric in a normed vector space which can be considered as a generalization of both the Euclidean distance and the Manhattan distance. It is named after the German mathematician Hermann Minkowski. reference: en.wikipedia.org double(point_ax,...
Currently in PineScript you cannot modify global variables in functions because of scope limitations. One way to work around that is to use arrays. This Library simplifies the use of arrays as global variables to make your code look cleaner. If you're coming from other programming languages, I'm sure you will come across this issue in your PineScript journey at...
Library "FunctionGenerateRandomPointsInShape" Generate random vector points in geometric shape (parallelogram, triangle) random_parallelogram(vector_a, vector_b) Generate random vector point in a parallelogram shape. Parameters: vector_a : float array, vector of (x, y) shape. vector_b : float array, vector of (x, y) shape. Returns: float array,...
Library "FunctionArrayNextPrevious" Methods to iterate through a array by a fixed anchor point. array_next(array, start_index) retrieves the next value of the internal pointer index. Parameters: array : (any array type), array to iterate. start_index : int, anchor index to start indexing. array_previous(array, start_index) retrieves the...
Library "FunctionNNLayer" Generalized Neural Network Layer method. function(inputs, weights, n_nodes, activation_function, bias, alpha, scale) Generalized Layer. Parameters: inputs : float array, input values. weights : float array, weight values. n_nodes : int, number of nodes in layer. activation_function : string, default='sigmoid',...
Library "FunctionNNPerceptron" Perceptron Function for Neural networks. function(inputs, weights, bias, activation_function, alpha, scale) generalized perceptron node for Neural Networks. Parameters: inputs : float array, the inputs of the perceptron. weights : float array, the weights for inputs. bias : float, default=1.0, the default bias...
Library "MLActivationFunctions" Activation functions for Neural networks. binary_step(value) Basic threshold output classifier to activate/deactivate neuron. Parameters: value : float, value to process. Returns: float linear(value) Input is the same as output. Parameters: value : float, value to process. Returns: float sigmoid(value) ...
Library "MLLossFunctions" Methods for Loss functions. mse(expects, predicts) Mean Squared Error (MSE) " MSE = 1/N * sum ((y - y')^2) ". Parameters: expects : float array, expected values. predicts : float array, prediction values. Returns: float binary_cross_entropy(expects, predicts) Binary Cross-Entropy Loss (log). Parameters: ...
Library "Points" Provides functions for simplifying operations with collections of x+y coordinates. Where x is typically a bar index or time (millisecond) value. new(size) Creates two arrays. One for X (int ) and another for Y (float ). Parameters: size : The initial size of the arrays. size(xA, yA) Checks the size of the arrays and if they're...
Library "eHarmonicpatterns" Library provides an alternative method to scan harmonic patterns. This is helpful in reducing iterations scan_xab(bcdRatio, err_min, err_max, patternArray) Checks if bcd ratio is in range of any harmonic pattern Parameters: bcdRatio : AB/XA ratio err_min : minimum error threshold err_max : maximum error...
A simple hashmap implementation for pinescript. It gets your string array and transforms it into a hashmap. Before using it you need to initialize your array with the size you need for your specific case since the size is not dynamic. To use it, first you need to import it the following way: > import marspumpkin/hashmaps/1 Then, initialize your array with the...
This Library is aimed to mitigate the limitation of Pinescript having only one structured data type which is only arrays. It lacks data types like Dictionaries(in Python) or Object (in JS) that are standard for other languages. Tuples do exist, but it hardly solves any problem. Working only with Arrays could be overwhelming if your codebase is large. I looked for...
Library "FunctionPeakDetection" Method used for peak detection, similar to MATLAB peakdet method function(sample_x, sample_y, delta) Method for detecting peaks. Parameters: sample_x : float array, sample with indices. sample_y : float array, sample with data. delta : float, positive threshold value for detecting a peak. Returns: tuple with...
Library "Averages" Contains utilities for generating averages from arrays. Useful for manipulated or cleaned data. triangular(src, startingWeight) Calculates the triangular weighted average of a set of values where the last value has the highest weight. Parameters: src : The array to derive the average from. startingWeight : The weight to begin...
Library "_arrayutils" Library contains utility functions using arrays. delete(arr, index) remove an item from array at specific index. Also deletes the item Parameters: arr : - array from which the item needs to be deleted index : - index of item to be deleted Returns: void pop(arr) remove the last item from array. Also deletes the...
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 .