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.
Mã nguồn mở

Với tinh thần TradingView, tác giả của tập lệnh này đã xuất bản nó dưới dạng mã nguồn mở, vì vậy các nhà giao dịch có thể hiểu và xác minh nó. Chúc mừng tác giả! Bạn có thể sử dụng mã này miễn phí, nhưng việc sử dụng lại mã này trong một ấn phẩm chịu sự điều chỉnh của Nội quy nội bộ. Bạn có thể yêu thích nó để sử dụng nó trên biểu đồ.

Thông báo miễn trừ trách nhiệm

Thông tin và ấn phẩm không có nghĩa là và không cấu thành, tài chính, đầu tư, kinh doanh, hoặc các loại lời khuyên hoặc khuyến nghị khác được cung cấp hoặc xác nhận bởi TradingView. Đọc thêm trong Điều khoản sử dụng.

Bạn muốn sử dụng tập lệnh này trên biểu đồ?