RicardoSantos

FunctionArrayReduce

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

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.

Want to use this library?

Copy the following line and paste it in your script.