alma

alma

Arnaud Legoux 移動平均、それは移動平均の加重にガウシアン分布を用います。

alma(series, length, offset, sigma) → series[float]

plot(alma(close, 9, 0.85, 6))

// same on pine, but much less efficient
pine_alma(series, windowsize, offset, sigma) =>
    m = floor(offset * (windowsize - 1))
    s = windowsize / sigma
    norm = 0.0
    sum = 0.0
    for i = 0 to windowsize - 1
        weight = exp(-1 * pow(i - m, 2) / (2 * pow(s, 2)))
        norm := norm + weight
        sum := sum + series[windowsize - i - 1] * weight
    sum / norm
plot(pine_alma(close, 9, 0.85, 6))

戻り
Arnaud Legoux 移動平均

引数
series (series) 処理する値の系列。
length (integer) バーの数(長さ)。
offset (float) 滑らかさ(1に近い)と応答性(0に近い)との間のトレードオフを制御する。
sigma (float) ALMAの滑らかさを変えます。 シグマが大きいほどより滑らかなALMA。

\ 最新情報をチェック /

コメントを残す

Pineスクリプト

前の記事

alertcondition
Pineスクリプト

次の記事

asin