OPEN-SOURCE SCRIPT
업데이트됨 Mean Reversion Indicator

Mean Reversion Indicator
The "Mean Reversion Indicator" combines the Augmented Dickey-Fuller (ADF) test and the Hurst Exponent to identify potential mean reversion points in a time series.
Key Features:
Augmented Dickey-Fuller (ADF) Test: This test helps determine if a time series is mean-reverting by comparing the test statistic against critical values at different confidence levels (90%, 95%, 99%).
Hurst Exponent Calculation: The Hurst exponent is used to distinguish between trending, mean-reverting, or random walk behaviors of the time series.
Standard Deviation Sampling: The script calculates standard deviations over different sampling periods to assess volatility.
Visual Representation:
The green color indicates the time series is mean-reverting.
The purple color shows a trending or random walk behavior.
A zero line is plotted for easy reference.
Bar colors change according to the mean reversion state.
How to Use:
Apply the indicator to your preferred chart.
Configure the settings to match your trading strategy.
Observe the color changes and zero line to make informed decisions about potential mean reversion points.
This indicator is a powerful tool for traders looking to exploit mean reversion strategies by combining statistical tests and advanced mathematical calculations.
Credits to george_608 for helping me with this indicator
The "Mean Reversion Indicator" combines the Augmented Dickey-Fuller (ADF) test and the Hurst Exponent to identify potential mean reversion points in a time series.
Key Features:
Augmented Dickey-Fuller (ADF) Test: This test helps determine if a time series is mean-reverting by comparing the test statistic against critical values at different confidence levels (90%, 95%, 99%).
Hurst Exponent Calculation: The Hurst exponent is used to distinguish between trending, mean-reverting, or random walk behaviors of the time series.
Standard Deviation Sampling: The script calculates standard deviations over different sampling periods to assess volatility.
Visual Representation:
The green color indicates the time series is mean-reverting.
The purple color shows a trending or random walk behavior.
A zero line is plotted for easy reference.
Bar colors change according to the mean reversion state.
How to Use:
Apply the indicator to your preferred chart.
Configure the settings to match your trading strategy.
Observe the color changes and zero line to make informed decisions about potential mean reversion points.
This indicator is a powerful tool for traders looking to exploit mean reversion strategies by combining statistical tests and advanced mathematical calculations.
Credits to george_608 for helping me with this indicator
릴리즈 노트
Enhanced Calculation Method:Introduced a combined approach using Hull Moving Average (HMA) and Exponential Moving Average (EMA) for a smoother final value calculation.
Value Clamping:
Added clamping for the final value to ensure it stays within the range of -1 to 1, improving stability and interpretability of the indicator.
Market State Indicator:
Included a marketState variable to easily identify whether the market is in a "Trending" or "Reverting" state based on the final value.
Visualization Enhancements:
Updated plot colors: The final value is now plotted with color.fuchsia for negative values and color.rgb(0, 234, 255, 0) for positive values.
Added a table displaying the market state and the final value for better clarity and quick reference.
릴리즈 노트
Improved Calculation Methods:- Updated deviation calculations using ta.dev for more accurate deviation measures.
- Enhanced Hurst exponent estimation using bar_index for better trend/reversion detection.
Augmented Dickey-Fuller (ADF) Test:
Integrated ADF test to determine mean reversion properties with dynamically set thresholds.
Directional Movement Index (DMI):
Incorporated DMI to refine market state determination.
Enhanced Final Calculation:
- Combined EMA and HMA values for a more balanced final trend/reversion indication.
- Clamped final HMA values between -1 and 1 for stability.
Market State Indicator:
Added a detailed market state indicator to differentiate between "Trending", "Ranging", and "Peak/Danger" states.
Visualization Enhancements:
- Updated plot colors: Used color.fuchsia for negative values and color.rgb(0, 234, 255, 0) for positive values.
- Enhanced background color to indicate dangerous market peaks.
- Added horizontal lines at 1, 0, and -1 for clear reference points.
- Updated table to display market state and the final value with improved text alignment and color coding.
릴리즈 노트
Slight bug fixImproved table
Added in optional trigger for bar color in "Danger" zones
오픈 소스 스크립트
진정한 트레이딩뷰 정신에 따라 이 스크립트 작성자는 트레이더가 기능을 검토하고 검증할 수 있도록 오픈소스로 공개했습니다. 작성자에게 찬사를 보냅니다! 무료로 사용할 수 있지만 코드를 다시 게시할 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.
오픈 소스 스크립트
진정한 트레이딩뷰 정신에 따라 이 스크립트 작성자는 트레이더가 기능을 검토하고 검증할 수 있도록 오픈소스로 공개했습니다. 작성자에게 찬사를 보냅니다! 무료로 사용할 수 있지만 코드를 다시 게시할 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.