PINE LIBRARY
Aggiornato

MathHelpers

311
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.
Note di rilascio
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

Declinazione di responsabilità

Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.