RicardoSantos

MathProbabilityDistribution

Library "MathProbabilityDistribution"
Probability Distribution Functions.

name( idx ) Indexed names helper function.
  Parameters:
    idx: int, position in the range (0, 6).
  Returns: string, distribution name.
usage:
.name(1)
Notes:
(0) => 'StdNormal'
(1) => 'Normal'
(2) => 'Skew Normal'
(3) => 'Student T'
(4) => 'Skew Student T'
(5) => 'GED'
(6) => 'Skew GED'

zscore(position, mean, deviation) Z-score helper function for x calculation.
  Parameters:
    position: float, position.
    mean: float, mean.
    deviation: float, standard deviation.
  Returns: float, z-score.
usage:
.zscore(1.5, 2.0, 1.0)

std_normal(position) Standard Normal Distribution.
  Parameters:
    position: float, position.
  Returns: float, probability density.
usage:
.std_normal(0.6)

normal(position, mean, scale) Normal Distribution.
  Parameters:
    position: float, position in the distribution.
    mean: float, mean of the distribution, default=0.0 for standard distribution.
    scale: float, scale of the distribution, default=1.0 for standard distribution.
  Returns: float, probability density.
usage:
.normal(0.6)

skew_normal(position, skew, mean, scale) Skew Normal Distribution.
  Parameters:
    position: float, position in the distribution.
    skew: float, skewness of the distribution.
    mean: float, mean of the distribution, default=0.0 for standard distribution.
    scale: float, scale of the distribution, default=1.0 for standard distribution.
  Returns: float, probability density.
usage:
.skew_normal(0.8, -2.0)

ged(position, shape, mean, scale) Generalized Error Distribution.
  Parameters:
    position: float, position.
    shape: float, shape.
    mean: float, mean, default=0.0 for standard distribution.
    scale: float, scale, default=1.0 for standard distribution.
  Returns: float, probability.
usage:
.ged(0.8, -2.0)

skew_ged(position, shape, skew, mean, scale) Skew Generalized Error Distribution.
  Parameters:
    position: float, position.
    shape: float, shape.
    skew: float, skew.
    mean: float, mean, default=0.0 for standard distribution.
    scale: float, scale, default=1.0 for standard distribution.
  Returns: float, probability.
usage:
.skew_ged(0.8, 2.0, 1.0)

student_t(position, shape, mean, scale) Student-T Distribution.
  Parameters:
    position: float, position.
    shape: float, shape.
    mean: float, mean, default=0.0 for standard distribution.
    scale: float, scale, default=1.0 for standard distribution.
  Returns: float, probability.
usage:
.student_t(0.8, 2.0, 1.0)

skew_student_t(position, shape, skew, mean, scale) Skew Student-T Distribution.
  Parameters:
    position: float, position.
    shape: float, shape.
    skew: float, skew.
    mean: float, mean, default=0.0 for standard distribution.
    scale: float, scale, default=1.0 for standard distribution.
  Returns: float, probability.
usage:
.skew_student_t(0.8, 2.0, 1.0)

select(distribution, position, mean, scale, shape, skew, log) Conditional Distribution.
  Parameters:
    distribution: string, distribution name.
    position: float, position.
    mean: float, mean, default=0.0 for standard distribution.
    scale: float, scale, default=1.0 for standard distribution.
    shape: float, shape.
    skew: float, skew.
    log: bool, if true apply log() to the result.
  Returns: float, probability.
usage:
.select('StdNormal', __CYCLE4F__, log=true)

Pine腳本庫

本著真正的TradingView精神,作者將此Pine代碼以開源腳本庫發布,以便我們社群的其他Pine程式設計師可以重用它。向作者致敬!您可以私下或在其他開源出版物中使用此庫,但在出版物中重用此代碼受網站規則約束。

免責聲明

這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。

想使用這個腳本庫嗎?

複製以下行並將其黏貼到您的腳本中。