PINE LIBRARY
Diupdate

MathHelpers

319
Library "MathHelpers"

Overview

A collection of helper functions for designing indicators and strategies.

calculateATR(length, log)
  Calculates the Average True Range (ATR) or Log ATR based on the 'log' parameter. Sans Wilder's Smoothing
  Parameters:
    length (simple int)
    log (simple bool)
  Returns: float The calculated ATR value. Returns Log ATR if `log` is true, otherwise returns standard ATR.

CDF(z)
  Computes the Cumulative Distribution Function (CDF) for a given value 'z', mimicking the CDF function in "Statistically Sound Indicators" by Timothy Masters.
  Parameters:
    z (simple float)
  Returns: float The CDF value corresponding to the input `z`, ranging between 0 and 1.

logReturns(lookback)
  Calculates the logarithmic returns over a specified lookback period.
  Parameters:
    lookback (simple int)
  Returns: float The calculated logarithmic return. Returns `na` if insufficient data is available.
Catatan Rilis
v2

Updated:
CDF(z)
  Computes the Cumulative Distribution Function (CDF) for a given value 'z', mimicking the CDF function in "Statistically Sound Indicators" by Timothy Masters.
  Parameters:
    z (float)
  Returns: float The CDF value corresponding to the input `z`, ranging between 0 and 1.

Changed from 'simple float' to just 'float' for accepting a series float

Pernyataan Penyangkalan

Informasi dan publikasi tidak dimaksudkan untuk menjadi, dan bukan merupakan saran keuangan, investasi, perdagangan, atau rekomendasi lainnya yang diberikan atau didukung oleh TradingView. Baca selengkapnya di Persyaratan Penggunaan.