OPEN-SOURCE SCRIPT
MAD Adaptive RSI [NJ]

✧ OVERVIEW ✧
MAD Adaptive RSI combines Relative Strength Index with adaptive thresholds based on Median Absolute Deviation.
MAD measures recent price volatility and adjusts bullish and bearish RSI thresholds accordingly. Wider price dispersion moves thresholds farther apart, while lower dispersion brings them closer together.
This allows signal requirements to adapt to changing market conditions instead of relying on fixed RSI levels.

✧ SETTINGS ✧
Color Mode
Switches between colored and neutral visualization.
Color Candles
Shows or hides candle coloring based on the current signal.
MAD Length
Controls how much price history is used for Median Absolute Deviation calculation.
MAD Smoothing
Controls smoothing applied to normalized MAD values.
MAD Multiplier
Controls how strongly MAD affects adaptive thresholds.
Threshold Base
Sets central level around which bullish and bearish thresholds are calculated.
✧ HOW IT WORKS ✧
Median Absolute Deviation
Indicator calculates median price over selected MAD Length and measures absolute deviations of closing prices from that median.
Median of those deviations produces MAD, providing a measure of recent price volatility that is less affected by extreme values.
Normalization and Smoothing
MAD is converted into a percentage of current closing price, making its value more comparable across different price levels.
Normalized MAD is then smoothed and multiplied by MAD Multiplier.
Resulting adjustment is capped at 10 to prevent thresholds from expanding excessively.
Adaptive Thresholds
Smoothed MAD adjustment is added to and subtracted from Threshold Base.
Upper threshold increases as price volatility grows, while lower threshold decreases.
RSI
A 14-period RSI is used as momentum input.
Signal Logic
A bullish condition is activated when RSI crosses above upper adaptive threshold.
A bearish condition is activated when RSI crosses below lower adaptive threshold.
While RSI remains between both thresholds, previous condition stays active.
✧ VISUALIZATION ✧
Green represents a bullish condition.
Red represents a bearish condition.
Neutral mode displays the same conditions using light and dark shades.
Upper and lower adaptive thresholds are plotted as dashed lines and move dynamically as MAD changes.
Same signal colors can optionally be applied directly to the chart candles.
✧ USAGE ✧
MAD Adaptive RSI can be used to identify:
Bullish and bearish momentum conditions
Momentum shifts confirmed by adaptive thresholds
Changes in price volatility
Potential directional transitions
Trend confirmation
Momentum context
Additional confirmation for other technical analysis
Adaptive thresholds require stronger RSI movement when price volatility is elevated and become more sensitive when volatility is lower.
Indicator is designed to provide directional momentum context while adjusting signal requirements to recent market conditions.
As with any technical indicator, it is best used alongside other forms of analysis rather than as a standalone entry or exit signal.
MAD Adaptive RSI combines Relative Strength Index with adaptive thresholds based on Median Absolute Deviation.
MAD measures recent price volatility and adjusts bullish and bearish RSI thresholds accordingly. Wider price dispersion moves thresholds farther apart, while lower dispersion brings them closer together.
This allows signal requirements to adapt to changing market conditions instead of relying on fixed RSI levels.
✧ SETTINGS ✧
Color Mode
Switches between colored and neutral visualization.
Color Candles
Shows or hides candle coloring based on the current signal.
MAD Length
Controls how much price history is used for Median Absolute Deviation calculation.
MAD Smoothing
Controls smoothing applied to normalized MAD values.
MAD Multiplier
Controls how strongly MAD affects adaptive thresholds.
Threshold Base
Sets central level around which bullish and bearish thresholds are calculated.
✧ HOW IT WORKS ✧
Median Absolute Deviation
Indicator calculates median price over selected MAD Length and measures absolute deviations of closing prices from that median.
Median of those deviations produces MAD, providing a measure of recent price volatility that is less affected by extreme values.
Normalization and Smoothing
MAD is converted into a percentage of current closing price, making its value more comparable across different price levels.
Normalized MAD is then smoothed and multiplied by MAD Multiplier.
Resulting adjustment is capped at 10 to prevent thresholds from expanding excessively.
Adaptive Thresholds
Smoothed MAD adjustment is added to and subtracted from Threshold Base.
Upper threshold increases as price volatility grows, while lower threshold decreases.
RSI
A 14-period RSI is used as momentum input.
Signal Logic
A bullish condition is activated when RSI crosses above upper adaptive threshold.
A bearish condition is activated when RSI crosses below lower adaptive threshold.
While RSI remains between both thresholds, previous condition stays active.
✧ VISUALIZATION ✧
Green represents a bullish condition.
Red represents a bearish condition.
Neutral mode displays the same conditions using light and dark shades.
Upper and lower adaptive thresholds are plotted as dashed lines and move dynamically as MAD changes.
Same signal colors can optionally be applied directly to the chart candles.
✧ USAGE ✧
MAD Adaptive RSI can be used to identify:
Bullish and bearish momentum conditions
Momentum shifts confirmed by adaptive thresholds
Changes in price volatility
Potential directional transitions
Trend confirmation
Momentum context
Additional confirmation for other technical analysis
Adaptive thresholds require stronger RSI movement when price volatility is elevated and become more sensitive when volatility is lower.
Indicator is designed to provide directional momentum context while adjusting signal requirements to recent market conditions.
As with any technical indicator, it is best used alongside other forms of analysis rather than as a standalone entry or exit signal.
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.