PINE LIBRARY

MathHelpers

已更新
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
MATHmathematicsmathsstatisticstatistics

Pine脚本库

本着真正的TradingView精神,作者将此Pine代码发布为开源脚本库,以便我们社区的其他Pine程序员可以重复使用它。向作者致敬!您可以私下或在其它开源出版物中使用此脚本库,但在出版物中重复使用此代码受网站规则约束。


更多:

免责声明