OPEN-SOURCE SCRIPT

Z-Scored Moving Average Suite [KFB Quant]

已更新
Z-Scored Moving Average Suite

This indicator combines several types of moving averages—Simple, Exponential, and Weighted—with a Z-Score calculation to give a clearer understanding of price trends in relation to their historical averages. It is used to detect overbought (OB) and oversold (OS) conditions, allowing you to see when an asset is deviating significantly from its mean.

Key Components:
  1. Moving Averages: The suite includes Simple (SMA), Exponential (EMA), and Weighted (WMA) Moving Averages. For each, a single, double, and triple version is calculated to smooth out noise.
  2. Z-Score: The Z-Score measures how far the current price is from its moving average in terms of standard deviations, helping to highlight unusual price behavior.
  3. Overbought and Oversold Levels:
    - When the Z-Score crosses above a predefined threshold (1.5 by default), the asset is considered Overbought (OB).
    - When the Z-Score drops below a certain level (-1.5 by default), the asset is seen as Oversold (OS).
  4. Visualization:
    - The histogram represents the average Z-Score of all the moving averages combined, colored based on bullish (blue) or bearish (brown) trends.
    - Individual Z-Scores for each moving average type (SMA, EMA, WMA) are also plotted, providing further insight into the momentum and direction.
  5. Signals:
    - The table in the chart shows a summary of Z-Scores for each type of moving average. It also provides a quick glance at whether the asset is in a bullish or bearish phase, if the Z-Scores are rising or falling, and whether the asset is overbought or oversold.


This tool is highly customizable, with adjustable lengths for the moving averages and Z-Scores, making it a flexible addition to any trading strategy that relies on mean-reversion or trend analysis.



Disclaimer: This tool is provided for informational and educational purposes only and should not be considered as financial advice. Always conduct your own research and consult with a licensed financial advisor before making any investment decisions.
版本注释
Cleaned code.
Moving AveragesOscillatorsTrend Analysis

开源脚本

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

想在图表上使用此脚本?

免责声明