Electrified

Averages

Electrified Mis à jour   
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 with when calculating the average. Higher numbers will decrease the bias.

weighted(src, weights, weightDefault) Calculates the weighted average of a set of values.
  Parameters:
    src: The array to derive the average from.
    weights: The array containing the weights for the source.
    weightDefault: The default value to use when a weight is NA.

triangularWeighted(src, weights, startingWeight) Calculates the weighted average of a set of values where the last value has the highest triangular multiple.
  Parameters:
    src: The array to derive the average from.
    weights: The array containing the weights for the source.
    startingWeight: The multiple to begin with when calculating the average. Higher numbers will decrease the bias.

exponential(src) Calculates the exponential average of a set of values where the last value has the highest weight.
  Parameters:
    src: The array to derive the average from.

arrayFrom(src, len, omitNA) Creates an array from the provided series (oldest to newest).
  Parameters:
    src: The array to derive from.
    len: The target length of the array.
    omitNA: If true, NA values will not be added to the array and the resultant array may be shorter than the target length.
Notes de version:
v2 Fixed doc param name
Notes de version:
v3 Improved array from series function.
Notes de version:
v4 fixed exponential calc.
Notes de version:
v5 Fixed issue with exponential not tracking like ema.
Notes de version:
v6
Bibliothèque Pine

Dans le véritable esprit de TradingView, l'auteur a publié ce code Pine en tant que bibliothèque open-source afin que d'autres programmeurs Pine de notre communauté puissent le réutiliser. Bravo à l'auteur ! Vous pouvez utiliser cette bibliothèque à titre privé ou dans d'autres publications open-source, mais la réutilisation de ce code dans une publication est régie par notre Règlement.

Clause de non-responsabilité

Les informations et les publications ne sont pas destinées à être, et ne constituent pas, des conseils ou des recommandations en matière de finance, d'investissement, de trading ou d'autres types de conseils fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.

Vous voulez utiliser cette bibliothèque?

Copiez le texte dans le presse-papiers et collez-le dans votre script.