PINE LIBRARY

FunctionArrayReduce

Updated
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 array).
    samples: float array, the data to process.
    arguments: float array, the extra arguments of the formula.
    initial_value: float, default=0, a initial base value for the process.
  Returns: float.
Notes:
** if initial value is specified as "na" it will default to the first element of samples.
Release Notes
v2
Update: supports boolean operations and float variables now.
arraysMATHreducestrings

Pine library

In true TradingView spirit, the author has published this Pine code as an open-source library so that other Pine programmers from our community can reuse it. Cheers to the author! You may use this library privately or in other open-source publications, but reuse of this code in a publication is governed by House rules.

Disclaimer