OPEN-SOURCE SCRIPT
Market Extreme Zones Index

The Market Extreme Zones Index is a new mean reversion (valuation) tool focused on catching long term oversold/overbought zones. Combining an enhanced RSI with a smoothed Z-score this indicator allows traders to find oppurtunities during highly oversold/overbought zones.
I will separate the explanation into the following parts:
1. How does it work?
2. Methodologies & Concepts
3. Use cases
How does it work?
The indicator attempts to catch highly unprobable events in either direction to capture reversal points over the long term. This is done by calculating the Z-Score of an enhanced RSI.
First we need to calculate the Enhanced RSI:
For this we need to calculate 2 additional lengths:
Length1 = user defined length
Length2 = Length1/2
Length3 = √Length
Now we need to calculate 3 different RSIs:
1st RSI => uses classic user defined source and classic user defined length.
2nd RSI => uses classic user defined source and Length 2.
3rd RSI => uses RSI 2 as source and Length 2
Now calculate the divergence:
RSI_base => 2nd RSI * 3 - 1st RSI - 3rd RSI
After this we need to calculate the median of the RSI_base over √Length and make a divergence of these 2:
RSI => RSI_base*2 - median
All that remains now is the Z-score calculations:
We need:
Average RSI value
Standard Deviation = a measure of how dispersed or spread out a set of data values are from their average
Z-score = (Current Value - Average Value) / Standard Deviation
After this we just smooth the Z-score with a Weighted Moving average with √Length
Methodology & Concepts
Mean Reversion Methodology:
The methodology behind mean reversion is the theory that asset prices will eventually return to their long-term average after deviating significantly, driven by the belief that extreme moves are temporary.
Z-Score Methodology:
A Z-score, or standard score, is a statistical measure that indicates how many standard deviations a data point is from the mean of a dataset. A positive z-score means the value is above the mean, a negative score means it's below, and a score of zero means the value is equal to the mean.
You might already be able to see where I am going with this:
Z-Score could be used for the extreme moves to capture reversal points.
By applying it to the RSI rather than the Price, we get a more accurate measurement that allow us to get a banger indicator.
Use Cases
Capturing reversal points
Trend Direction
- while the main use it for mean reversion, the values can indicate whether we are in an uptrend or a downtrend.
Advantages:
Visualization:
The indicator has many plots to ensure users can easily see what the indicator signals, such as highlighting extreme conditions with background colors.
Versatility:
This indicator works across multiple assets, including the S&P500 and more, so it is not only for crypto.
Final note:
No indicator alone is perfect.
Backtests are not indicative of future performance.
Hope you enjoy Gs!
Good luck!
I will separate the explanation into the following parts:
1. How does it work?
2. Methodologies & Concepts
3. Use cases
How does it work?
The indicator attempts to catch highly unprobable events in either direction to capture reversal points over the long term. This is done by calculating the Z-Score of an enhanced RSI.
First we need to calculate the Enhanced RSI:
For this we need to calculate 2 additional lengths:
Length1 = user defined length
Length2 = Length1/2
Length3 = √Length
Now we need to calculate 3 different RSIs:
1st RSI => uses classic user defined source and classic user defined length.
2nd RSI => uses classic user defined source and Length 2.
3rd RSI => uses RSI 2 as source and Length 2
Now calculate the divergence:
RSI_base => 2nd RSI * 3 - 1st RSI - 3rd RSI
After this we need to calculate the median of the RSI_base over √Length and make a divergence of these 2:
RSI => RSI_base*2 - median
All that remains now is the Z-score calculations:
We need:
Average RSI value
Standard Deviation = a measure of how dispersed or spread out a set of data values are from their average
Z-score = (Current Value - Average Value) / Standard Deviation
After this we just smooth the Z-score with a Weighted Moving average with √Length
Methodology & Concepts
Mean Reversion Methodology:
The methodology behind mean reversion is the theory that asset prices will eventually return to their long-term average after deviating significantly, driven by the belief that extreme moves are temporary.
Z-Score Methodology:
A Z-score, or standard score, is a statistical measure that indicates how many standard deviations a data point is from the mean of a dataset. A positive z-score means the value is above the mean, a negative score means it's below, and a score of zero means the value is equal to the mean.
You might already be able to see where I am going with this:
Z-Score could be used for the extreme moves to capture reversal points.
By applying it to the RSI rather than the Price, we get a more accurate measurement that allow us to get a banger indicator.
Use Cases
Capturing reversal points
Trend Direction
- while the main use it for mean reversion, the values can indicate whether we are in an uptrend or a downtrend.
Advantages:
Visualization:
The indicator has many plots to ensure users can easily see what the indicator signals, such as highlighting extreme conditions with background colors.
Versatility:
This indicator works across multiple assets, including the S&P500 and more, so it is not only for crypto.
Final note:
No indicator alone is perfect.
Backtests are not indicative of future performance.
Hope you enjoy Gs!
Good luck!
オープンソーススクリプト
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
免責事項
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.
オープンソーススクリプト
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
免責事項
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.