Ameno09

Z Score & Trend Following

Introduction:
The Z Score & Trend Following indicator is a tool used in financial markets to assess the standard deviation of a data point from its mean value over a specified period. It calculates the Z score, which is a measure of how many standard deviations an element is from the mean. This indicator also incorporates trend-following characteristics, allowing traders to visualize trends based on the Z score.

Indicator Parameters:

Standard Deviation Length: Determines the length of the standard deviation calculation.
Average Length: Specifies the length of the moving average used for the mean calculation.
Calculation Type: Allows users to choose between different types of moving averages (SMA, EMA, WMA, VMA, TMA).
Standard Deviations: Sets the number of standard deviations to be used for trend analysis.
Bar Color: Option to enable or disable bar coloring based on trend conditions.

Calculations:

Z Score Calculation: The Z score is calculated as the difference between the source data point and the moving average divided by the standard deviation.
zscore = (src - (getMA(src, length))) / ta.stdev(src, slength)

Plots:

Z Score Plot: Plots the Z score values, typically in green.
Inverted Z Score Plot: Plots the inverted Z score values (multiplied by -1), typically in red.

Lines:

Zero Line: A horizontal dotted line indicating zero.
Upper Threshold Line: A dotted line representing the upper threshold defined by the number of standard deviations.
Lower Threshold Line: A dotted line representing the lower threshold defined by the negative number of standard deviations.

Bar Color:

The bar color changes based on the Z score values and the predefined standard deviation thresholds. Green bars indicate values above the upper threshold, red bars indicate values below the lower threshold, lime bars indicate positive Z scores, and maroon bars indicate negative Z scores. Neutral values are represented by black bars.

Conclusion:

The Z Score & Trend Following indicator combines the statistical concept of Z score with trend-following characteristics to provide traders with insights into market trends and potential reversal points. By visualizing Z scores alongside trend analysis, traders can make more informed decisions regarding market entry and exit points.
Skrypt open-source

Zgodnie z prawdziwym duchem TradingView, autor tego skryptu opublikował go jako open-source, aby traderzy mogli go zrozumieć i zweryfikować. Brawo dla autora! Możesz używać go za darmo, ale ponowne wykorzystanie tego kodu w publikacji jest regulowane przez Dobre Praktyki. Możesz go oznaczyć jako ulubione, aby użyć go na wykresie.

Wyłączenie odpowiedzialności

Informacje i publikacje przygotowane przez TradingView lub jego użytkowników, prezentowane na tej stronie, nie stanowią rekomendacji ani porad handlowych, inwestycyjnych i finansowych i nie powinny być w ten sposób traktowane ani wykorzystywane. Więcej informacji na ten temat znajdziesz w naszym Regulaminie.

Chcesz użyć tego skryptu na wykresie?