OPEN-SOURCE SCRIPT

Z-Score Weighted Moving Averages

federalTacos5392bの投稿

Indicator: Z-Score Weighted Moving Averages
Another way of calculating moving average
This indicator calculates two types of weighted moving averages (WMAs) based on z-scores and inverse z-scores. The indicator's purpose is to provide traders with a unique perspective on price movements by assigning different weights to data points based on their deviations from the mean . The two types of WMAs generated are as follows:

Smoothed Weighted Moving Average (wma_smoothed):
Z-score is calculated as (price - SMA of price/(MAD*1.2533), where MAD is mean absolute deviation around the median).
Weights are assigned to each data point based on the inverse of (1 + absolute value of the z-scores). This emphasizes points closer to the mean and reduces the influence of extreme deviations.
The weighted moving average is computed using the calculated weights, giving more importance to data points with smaller z-scores and, therefore, points that are closer to the mean.

Dynamic Weighted Moving Average (wma_dynamic):
Z-scores are still calculated in the same way.
Weights are assigned based on the absolute value of the z-scores. This emphasizes data points with significant deviations from the mean, without considering the direction of deviation.
The weighted moving average is computed using these dynamic weights, giving more weight to data points that have larger absolute z-scores, irrespective of whether they are above or below the mean.
Moving Averages

オープンソーススクリプト

TradingViewの精神に則り、このスクリプトの作者は、トレーダーが理解し検証できるようにオープンソースで公開しています。作者に敬意を表します!無料で使用することができますが、このコードを投稿で再利用するには、ハウスルールに準拠する必要があります。 お気に入りに登録してチャート上でご利用頂けます。

チャートでこのスクリプトを利用したいですか?

免責事項