Functions in this library creates/updates zigzag array and shows the zigzag
getZigzag(zigzag, prd, max_array_size) calculates zigzag using period
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...
The new feature of arrays allows for a multitude of new possibilities within Pinescript. This script implements a bubble sort function with most probable efficiency of О(n^2) with a best-case being O(n). This sort does not require large amounts of memory to process and has advantages when sorting small lists of data.
The main advantages: Bubble sort is an...
intrabar_cross_value(a, b, step) Find the minimum difference of a intrabar cross and return its median value.
a : float, series a.
b : float, series b.
step : float, step to iterate x axis, default=0.01
This is an attempt to create a two dimensional floating point array from the pine single dimension array.
It enables some useful array functions like sorting, when you are trying to keep track of price and location in time or bars and you would like to sort the array.
Other array functions on this array will not work, like average and other statistical functions...
Method for Linear Regression using array sample points.
linreg(sample_x, sample_y) Performs Linear Regression over the provided sample points.
sample_x : float array, sample points X value.
sample_y : float array, sample points Y value.
Returns: tuple with:
_predictions: Array with adjusted Y...
A library containing helper functions.
_arrayFill(int, string) Fill a string array with given size and value.
int : size Total size of array.
string : value The value used for filling. (`NaN` is used if no argument is supplied).
Returns: A string array filled with given value.
_arrayFill(int, float) Fill a...
this is a work in progress (WIP) and prone to have some errors, so use at your own risk...
let me know if you find any issues..
Method for a generalized Neural Network.
network(x) Generalized Neural Network Method.
x : TODO: add parameter x description here
Returns: TODO: add what function returns
This script displays the close price and 4 sorted moving averages of your choice in a small repositionable panel and, when used on a higher timeframe, warns you when values may be different from actual values in the higher timeframe, inciting you to double check the actual values of the moving averages in the higher timeframe the panel is supposed to reflect.
Regression array Creator. Handy for weights, Auto Normalizes array while holding curves.
Curve Regression Values Tool
_size : (float) Number of Steps required (float works, future consideration)
_power : (float) Strength of value decrease
Returns: (float ) Array of multipliers from 1 downwards to 0.
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
Side / Boundary Based All Types Swapper
- three automagical types for Arrays, Matrixes, and Variables
-- no signal : Long/ Short position autoswap
-- true / false : Boolean based side choice
-- Src / Thresh : if source is above or below the threshold
- two operating modes for variables, Holding mode only for arrays/matrixes
-- with two ...
Method used for peak detection, similar to MATLAB peakdet method
function(sample_x, sample_y, delta) Method for detecting peaks.
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 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
bcdRatio : AB/XA ratio
err_min : minimum error threshold
err_max : maximum error...
K-Means Clustering Method.
nearest(point_x, point_y, centers_x, centers_y) finds the nearest center to a point and returns its distance and center index.
point_x : float, x coordinate of point.
point_y : float, y coordinate of point.
centers_x : float array, x coordinates of cluster centers.
List of non-Shariah stock for Bursa Malaysia as of Oct 2021
No parameter required
status() will return 1 if ticker in the list, 0 if ticker not in the list and 2 if ticker not from Bursa Malaysia
Example usage :
indicator("My Script", overlay = true)
import BURSATRENDBANDCHART/bursamalaysianonshariah/1 as...
The z-score is a way of counting the number of standard deviations between a given data value and the mean of the data set.
Z-score = (x̄ - μ) / (σ / √ n)
x̄ = sample mean (using the array.avg function = array(a,close ), where i = 1 to 21)
μ = population mean ( = avg(close, n))
σ = standard deviation of the population ( = stdev(close,n))
n = number of 'close'...
Standard Array Functions Library by RagingRocketBull 2021
This script provides a library of every standard Pinescript array function for live testing with all supported array types.
You can find the full list of supported standard array functions below.
There are several libraries:
- Common String Functions Library
- Common Array Functions Library
polyreg(sample_x, sample_y) Method to return a polynomial regression channel using (X,Y) sample points.
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.