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.
สคริปต์โอเพนซอร์ซ

ด้วยจิตวิญญาณของ TradingView อย่างแท้จริง ผู้เขียนสคริปต์นี้ได้เผยแพร่เป็นโอเพนซอร์ส เพื่อให้ผู้ค้าสามารถเข้าใจและตรวจสอบได้ ไชโยให้กับผู้เขียน! คุณสามารถใช้ได้ฟรี แต่การใช้รหัสนี้ซ้ำในสิ่งพิมพ์อยู่ภายใต้กฎระเบียบการใช้งาน คุณสามารถตั้งเป็นรายการโปรดเพื่อใช้บนชาร์ตได้

คำจำกัดสิทธิ์ความรับผิดชอบ

ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมที่ เงื่อนไขการใช้บริการ

ต้องการที่จะใช้สคริปต์นี้บนชาร์ตใช่ไหม?