OPEN-SOURCE SCRIPT

Z-Score Weighted Moving Averages


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

Skrip open-source

Dengan semangat TradingView yang sesungguhnya, penulis skrip ini telah menerbitkannya sebagai sumber terbuka, sehingga para trader dapat memahami dan memverifikasinya. Hormat untuk penulisnya! Anda dapat menggunakannya secara gratis, namun penggunaan kembali kode ini dalam publikasi diatur oleh Tata Tertib. Anda dapat memfavoritkannya untuk digunakan pada chart

Inggin menggunakan skrip ini pada chart?

Pernyataan Penyangkalan