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 정신에 따라, 이 스크립트의 저자는 트레이더들이 이해하고 검증할 수 있도록 오픈 소스로 공개했습니다. 저자에게 박수를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 출판물에서 이 코드를 재사용하는 것은 하우스 룰에 의해 관리됩니다. 님은 즐겨찾기로 이 스크립트를 차트에서 쓸 수 있습니다.

차트에 이 스크립트를 사용하시겠습니까?

면책사항