PINE LIBRARY
Mis à jour

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.
Notes de version
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

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.