OPEN-SOURCE SCRIPT
RSI Z-score | Lemniscuss

๐ง Introducing RSI Z-Score (RSI-Z) by Lemniscuss
๐ ๏ธ Overview
RSI Z-Score (RSI-Z) is a momentum-based market condition detector that transforms the classic Relative Strength Index (RSI) into a standardized volatility framework.
By applying Z-Score normalization to the RSI, this tool allows traders to identify statistically significant deviations in momentum โ cutting through noise and highlighting high-probability turning points.
RSI-Z is optimized for trend inflection detection and overextension spotting, providing both visual clarity and actionable trade signals with dynamic labeling and optional bar coloring.
๐ How It Works
1๏ธโฃ RSI Foundation
The system starts with a standard RSI calculation on a user-defined source and length (default: 45).
2๏ธโฃ Z-Score Normalization
The RSI values are standardized by subtracting their mean and dividing by the standard deviation over the same lookback.
This converts RSI into a statistical measure โ revealing how many standard deviations current momentum is from its mean.
3๏ธโฃ Threshold Logic
Two customizable thresholds define actionable zones:
โข Long Threshold โ Signals bullish momentum shifts when crossed upward
โข Short Threshold โ Signals bearish momentum shifts when crossed downward
4๏ธโฃ Signal State Tracking
A state variable locks in a bias (Long / Short / Neutral) until an opposing trigger appears, ensuring clear and consistent market bias mapping.
โจ Key Features
๐น Statistically Driven Momentum Detection โ Moves beyond fixed RSI overbought/oversold levels by using standard deviations for adaptive accuracy.
๐น Customizable Thresholds โ Fine-tune long/short triggers for different volatility environments.
๐น Clear Visual Feedback โ Candle coloring and signal labels make trade setups instantly recognizable.
๐น Overlay-Friendly โ Works directly on your main chart or in a separate pane.
โ๏ธ Custom Settings
โข Source: Price stream for RSI calculation (default: close)
โข RSI Length: Lookback period for RSI & Z-Score (default: 45)
โข Long Threshold: Z-score value for bullish signal (default: 1)
โข Short Threshold: Z-score value for bearish signal (default: -1.9)
โข Long/Cash Signal Labels: Toggle for "Long"/"Short" markers
โข Bar Coloring: Toggle for trend-based candle coloring
๐ Trading Applications
โ Trend Reversals โ Spot statistically significant shifts in momentum before traditional RSI signals trigger
โ Overextension Monitoring โ Identify when momentum has deviated too far from the mean
โ Mean Reversion Setups โ Use extreme Z-score values as potential reversion points
โ Bias Confirmation โ Combine with trend tools for higher conviction entries/exits
๐ Conclusion
RSI-Z by Lemniscuss offers a clean, statistics-backed upgrade to the classic RSI.
By framing momentum in standard deviation terms, it empowers traders to separate normal fluctuations from truly significant market moves โ making it a valuable tool for both trend traders and mean reversion specialists.
๐น Summary Highlights
1๏ธโฃ Statistical upgrade to RSI for higher-quality signals
2๏ธโฃ Threshold-based, customizable long/short triggers
3๏ธโฃ Visual candle coloring & signal labels for clarity
4๏ธโฃ Adaptable to trend, swing, or intraday strategies
๐ Disclaimer: Past performance is not indicative of future results. No indicator guarantees profitability โ always test and manage risk appropriately.
๐ ๏ธ Overview
RSI Z-Score (RSI-Z) is a momentum-based market condition detector that transforms the classic Relative Strength Index (RSI) into a standardized volatility framework.
By applying Z-Score normalization to the RSI, this tool allows traders to identify statistically significant deviations in momentum โ cutting through noise and highlighting high-probability turning points.
RSI-Z is optimized for trend inflection detection and overextension spotting, providing both visual clarity and actionable trade signals with dynamic labeling and optional bar coloring.
๐ How It Works
1๏ธโฃ RSI Foundation
The system starts with a standard RSI calculation on a user-defined source and length (default: 45).
2๏ธโฃ Z-Score Normalization
The RSI values are standardized by subtracting their mean and dividing by the standard deviation over the same lookback.
This converts RSI into a statistical measure โ revealing how many standard deviations current momentum is from its mean.
3๏ธโฃ Threshold Logic
Two customizable thresholds define actionable zones:
โข Long Threshold โ Signals bullish momentum shifts when crossed upward
โข Short Threshold โ Signals bearish momentum shifts when crossed downward
4๏ธโฃ Signal State Tracking
A state variable locks in a bias (Long / Short / Neutral) until an opposing trigger appears, ensuring clear and consistent market bias mapping.
โจ Key Features
๐น Statistically Driven Momentum Detection โ Moves beyond fixed RSI overbought/oversold levels by using standard deviations for adaptive accuracy.
๐น Customizable Thresholds โ Fine-tune long/short triggers for different volatility environments.
๐น Clear Visual Feedback โ Candle coloring and signal labels make trade setups instantly recognizable.
๐น Overlay-Friendly โ Works directly on your main chart or in a separate pane.
โ๏ธ Custom Settings
โข Source: Price stream for RSI calculation (default: close)
โข RSI Length: Lookback period for RSI & Z-Score (default: 45)
โข Long Threshold: Z-score value for bullish signal (default: 1)
โข Short Threshold: Z-score value for bearish signal (default: -1.9)
โข Long/Cash Signal Labels: Toggle for "Long"/"Short" markers
โข Bar Coloring: Toggle for trend-based candle coloring
๐ Trading Applications
โ Trend Reversals โ Spot statistically significant shifts in momentum before traditional RSI signals trigger
โ Overextension Monitoring โ Identify when momentum has deviated too far from the mean
โ Mean Reversion Setups โ Use extreme Z-score values as potential reversion points
โ Bias Confirmation โ Combine with trend tools for higher conviction entries/exits
๐ Conclusion
RSI-Z by Lemniscuss offers a clean, statistics-backed upgrade to the classic RSI.
By framing momentum in standard deviation terms, it empowers traders to separate normal fluctuations from truly significant market moves โ making it a valuable tool for both trend traders and mean reversion specialists.
๐น Summary Highlights
1๏ธโฃ Statistical upgrade to RSI for higher-quality signals
2๏ธโฃ Threshold-based, customizable long/short triggers
3๏ธโฃ Visual candle coloring & signal labels for clarity
4๏ธโฃ Adaptable to trend, swing, or intraday strategies
๐ Disclaimer: Past performance is not indicative of future results. No indicator guarantees profitability โ always test and manage risk appropriately.
Skrip sumber terbuka
Dalam semangat sebenar TradingView, pencipta skrip ini telah menjadikannya sumber terbuka supaya pedagang dapat menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupun anda boleh menggunakannya secara percuma, ingat bahawa menerbitkan semula kod ini adalah tertakluk kepada Peraturan Dalaman kami.
Penafian
Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.
Skrip sumber terbuka
Dalam semangat sebenar TradingView, pencipta skrip ini telah menjadikannya sumber terbuka supaya pedagang dapat menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupun anda boleh menggunakannya secara percuma, ingat bahawa menerbitkan semula kod ini adalah tertakluk kepada Peraturan Dalaman kami.
Penafian
Maklumat dan penerbitan adalah tidak dimaksudkan untuk menjadi, dan tidak membentuk, nasihat untuk kewangan, pelaburan, perdagangan dan jenis-jenis lain atau cadangan yang dibekalkan atau disahkan oleh TradingView. Baca dengan lebih lanjut di Terma Penggunaan.