PINE LIBRARY
已更新 Averages

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.
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.
發行說明
v2 Fixed doc param name發行說明
v3 Improved array from series function.發行說明
v4 fixed exponential calc.發行說明
v5 Fixed issue with exponential not tracking like ema.發行說明
v6Pine腳本庫
秉持 TradingView 一貫的共享精神,作者將此 Pine 程式碼發佈為開源庫,讓社群中的其他 Pine 程式設計師能夠重複使用。向作者致敬!您可以在私人專案或其他開源發佈中使用此庫,但在公開發佈中重複使用該程式碼需遵守社群規範。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。
Pine腳本庫
秉持 TradingView 一貫的共享精神,作者將此 Pine 程式碼發佈為開源庫,讓社群中的其他 Pine 程式設計師能夠重複使用。向作者致敬!您可以在私人專案或其他開源發佈中使用此庫,但在公開發佈中重複使用該程式碼需遵守社群規範。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。