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 .
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...