PINE LIBRARY
מעודכן

MathHelpers

312
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.
הערות שחרור
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

כתב ויתור

המידע והפרסומים אינם אמורים להיות, ואינם מהווים, עצות פיננסיות, השקעות, מסחר או סוגים אחרים של עצות או המלצות שסופקו או מאושרים על ידי TradingView. קרא עוד בתנאים וההגבלות.