tkarolak

VWMA/SMA Delta Volatility (Statistical Anomaly Detector)

tkarolak 已更新   
The "VWMA/SMA Delta Volatility (Statistical Anomaly Detector)" indicator is a tool designed to detect and visualize volatility in a financial market's price data. The indicator calculates the difference (delta) between two moving averages (VWMA/SMA) and uses statistical analysis to identify anomalies or extreme price movements. Here's a breakdown of its components:

Hypothesis:
The hypothesis behind this indicator is that extreme price movements or anomalies in the market can be detected by analyzing the difference between two moving averages and comparing it to a statistically derived normal distribution. When the MA delta (the difference between two MAs: VWMA/SMA) exceeds a certain threshold based on standard deviation and the Z-score coefficient, it may indicate increased market volatility or potential trading opportunities.

Calculation of MA Delta:
The indicator calculates the MA delta by subtracting a simple moving average (SMA) from a volume-weighted moving average (VWMA) of a selected price source. This calculation represents the difference in the market's short-term and long-term trends.

Statistical Analysis:
To detect anomalies, the indicator performs statistical analysis on the MA delta. It calculates a moving average (MA) of the MA delta and its standard deviation over a specified sample size. This MA acts as a baseline, and the standard deviation is used to measure how much the MA delta deviates from the mean.

Delta Normalization:
The MA delta, lower filter, and upper filter are normalized using a function that scales them to a specific range, typically from -100 to 100. Normalization helps in comparing these values on a consistent scale and enhances their visual representation.

Visual Representation:
The indicator visualizes the results through histograms and channels:
  • The histogram bars represent the normalized MA delta. Red bars indicate negative and below-lower-filter values, green bars indicate positive and above-upper-filter values, and silver bars indicate values within the normal range.
  • It also displays a Z-score channel, which represents the upper and lower filters after normalization. This channel helps traders identify price levels that are statistically significant and potentially indicative of market volatility.
In summary, the "MA Delta Volatility (Statistical Anomaly Detector)" indicator aims to help traders identify abnormal price movements in the market by analyzing the difference between two moving averages and applying statistical measures. It can be a valuable tool for traders looking to spot potential opportunities during periods of increased volatility or to identify potential market anomalies.
版本注释:
Code refactor
版本注释:
Enhanced the robustness of the normalization function.
版本注释:
Incorporated an indicator description as comments within the code to provide better context and understanding

开源脚本

本着真正的TradingView精神,该脚本的作者将其开源发布,以便交易者可以理解和验证它。为作者喝彩!您可以免费使用它,但在出版物中重复使用此代码受网站规则的约束。 您可以收藏它以在图表上使用。

免责声明

这些信息和出版物并不意味着也不构成TradingView提供或认可的金融、投资、交易或其它类型的建议或背书。请在使用条款阅读更多信息。

想在图表上使用此脚本?