Electrified

Averages

Electrified Cập nhật   
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.
Phát hành các Ghi chú:
v2 Fixed doc param name
Phát hành các Ghi chú:
v3 Improved array from series function.
Phát hành các Ghi chú:
v4 fixed exponential calc.
Phát hành các Ghi chú:
v5 Fixed issue with exponential not tracking like ema.
Phát hành các Ghi chú:
v6
Thư viện Pine

Với tinh thần TradingView thực sự, tác giả đã xuất bản mã Pine này như một thư viện mã nguồn mở để các lập trình viên Pine khác từ cộng đồng của chúng tôi có thể sử dụng lại nó. Chúc mừng tác giả! Bạn có thể sử dụng thư viện này một cách riêng tư hoặc trong các ấn phẩm mã nguồn mở khác, nhưng việc sử dụng lại mã này trong một ấn phẩm chịu sự điều chỉnh của Nội quy chung.

Thông báo miễn trừ trách nhiệm

Thông tin và ấn phẩm không có nghĩa là và không cấu thành, tài chính, đầu tư, kinh doanh, hoặc các loại lời khuyên hoặc khuyến nghị khác được cung cấp hoặc xác nhận bởi TradingView. Đọc thêm trong Điều khoản sử dụng.

Bạn muốn sử dụng thư viện này?

Sao chép văn bản vào khay nhớ tạm và dán nó vào tập lệnh của bạn.