OPEN-SOURCE SCRIPT

Sigma Score

Function and Purpose
The Sigma Score indicator is a tool for analyzing volatility and identifying unusual price movements of a financial instrument over a specified timeframe. It calculates the "Sigma Score," which measures how far the current price change deviates from its historical average in terms of standard deviations. This helps identify potential extremes and unusual market conditions.

Features
  • Timeframe Control
  • Users can select the desired timeframe for analysis (e.g., minutes, hours, days). This makes the indicator adaptable to various trading styles:
  • Supported timeframes: Minutes (M1, M5, M10, M15), Hours (H1, H4, H12), Days (D), Weeks (W), Months (M).


Sigma Score Calculation
  • The indicator computes the logarithmic return between consecutive price values.
  • It calculates a simple moving average (SMA) and the standard deviation (StDev) of these returns.
  • The Sigma Score is derived as the difference between the current return and the average, divided by the standard deviation.


Visual Representation
Sigma Score Plot: The Sigma Score is displayed as a line.
Horizontal Threshold Lines:
  • A middle line (0) for reference.
  • Upper and lower threshold lines (default: 2.0 and -2.0) for highlighting extremes.

Background Highlighting:
  • Green for values above the upper threshold (positive deviations).
  • Red for values below the lower threshold (negative deviations).


Custom Settings
  • Timeframe
  • Select the timeframe for analysis using a dropdown menu (default: D for daily).
  • Thresholds
  • Upper Threshold: Default = 2.0 (positive extreme area).
  • Lower Threshold: Default = -2.0 (negative extreme area).
  • Both values can be adjusted to modify the indicator's sensitivity.


Use Cases
  • Identifying Extremes: Values above or below the thresholds can signal unusual market conditions, such as overbought or oversold areas.
  • Analyzing Market Anomalies: The Sigma Score quantifies how unusual a price movement is based on historical data.
  • Visual Aid: Threshold lines and background highlighting simplify the interpretation of boundary conditions.


Notes and Limitations
  • Timeframe Dependency: Results may vary depending on the selected timeframe. Shorter timeframes highlight short-term movements, while longer timeframes capture broader trends.
  • Volatility Sensitivity: The indicator is sensitive to changes in market volatility. Sudden price swings may produce extreme Sigma values.


Summary
The Sigma Score indicator is a powerful tool for traders and analysts to quickly identify unusual market conditions and make informed decisions. Its flexibility in adjusting timeframes and thresholds makes it a versatile addition to any trading strategy.
Breadth IndicatorsOscillatorsVolatility

Mã nguồn mở

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

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

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