Library "FunctionKellyCriterion" Kelly criterion methods. the kelly criterion helps with the decision of how much one should invest in a asset as long as you know the odds and expected return of said asset. simplified(win_p, rr) simplified version of the kelly criterion formula. Parameters: win_p : float, probability of winning. rr : float,...
Library "FunctionDynamicTimeWarping" "In time series analysis, dynamic time warping (DTW) is an algorithm for measuring similarity between two temporal sequences, which may vary in speed. For instance, similarities in walking could be detected using DTW, even if one person was walking faster than the other, or if there were accelerations and decelerations...
Library "FunctionArrayUnique" Method for retrieving the unique elements in a array. for example would retrieve a array with , the elements retrieved will be sorted by its first seen index in parent array. note: float values have no precision option. unique(source) method for retrieving the unique elements in a array. Parameters: source : array...
Library "functionStringToMatrix" Provides unbound methods (no error checking) to parse a string into a float or int matrix. to_matrix_float(str, interval_sep, start_tk, end_tk) Parse a string into a float matrix. Parameters: str : , string, the formated string to parse. interval_sep : , string, cell interval separator token. start_tk : ,...
This indicator provides some base code for looping over data to identify swings in price action. Full code commentary can be found on the backtest rookies website. The indicator shall allow users to "analyse" a recent historical candle to detect whether it was a swing point. This will work by inputting a number to select which historical candle you want to...
Hi fellow traders.. Happy to share a Linear Regression & RSI Multi-Function Custom Screener with Table-Labels... The Screener scans for Linear Regression 2-SD Breakouts and RSI OB/OS levels for the coded tickers and gives Summary alerts Uses Tables (dynamica resizing) for the scanner output instead of standard labels! This Screener cum indicator collection has...
Nth-Occurrence Custom barssince() Function by Cryptorhythms Description The vanilla barssince() function in pine only finds the number of bars since the most recent occurrence of the condition. This version allows you to specify an Nth occurrence back to check the bars since! Its also a nice little one liner. I really hope you enjoy it and if you're...
20 step red/green gradient function The color gradient function allow colorize any source in 5% steps. Define the source, minimum and maximum value (constant or , for example, bb (or any other channel)).
Function for standardization or zScore.
A Magical little helper friend for Candle Math. When composing scripts, it is often necessary to manipulate the math around the OHLC. At times, you want a scalar (absolute) value others you want a vector (+/-). Sometimes you want the open - close and sometimes you want just the positive number of the body size. You might want it in ticks or you might want it in...
Description: A function that returns a polynomial regression and deviation information for a data set. Inputs: _X: Array containing x data points. _Y: Array containing y data points. Outputs: _predictions: Array with adjusted _Y values. _max_dev: Max deviation from the mean. _min_dev: Min deviation from the mean. ...
This script plots vertical lines on charts or indicators. Unfortunately pinescript is lacking a vertical line plotting function. Vertical lines are useful to mark events, such as crossover of levels, indicators signals or as a time marker. After searching the internet for a long time and trying different scripts, this script is the simplest and visually the...
EXPERIMENTAL: Using keltner channels with automatic multiplier finding, offsets and show_last cutoffs to generate a forecast area. video showing why its named keltner worms :p.. streamable.com
Calculates weighted mean, variance, standard deviation, MSE and RMSE from time series variables or arrays. When calculating from arrays, the function expects index 0 to be the most recent sample and weight values.
An utility function to parse session inputs. Extracts hours, minutes and weekdays (if defined) and returns a tuple as the result. _parseSession(sessionString) => (hourStart, minuteStart, hourEnd, minuteEnd, weekdaysArray) Examples presented on the chart.
Description: A Function that returns a linear regression channel using (X,Y) vector points. Inputs: _X: Array containing x data points.¹ _Y: Array containing y data points.¹ Note: ¹: _X and _Y size must match. Outputs: _predictions: Array with adjusted _Y values at _X. _max_dev: Max deviation from the mean. _min_dev:...
Example function of a markov chain monte carlo simulation.