OPEN-SOURCE SCRIPT
Relative Strength Index - RSI

🎯 Overview
This is an enhanced Relative Strength Index (RSI) indicator for TradingView that combines traditional RSI analysis with a moving average overlay to generate more reliable trading signals ⚡
🧩 Core Components
1. ⚙️ Indicator Settings
2. 🎛️ Input Parameters
A. 🎨 Color Settings:
5 different color themes: 🎨 Classic, 🚀 Modern, 💪 Robust, 🌈 Accented, ⚫⚪ Monochrome
Each theme provides distinct bullish/bearish color pairs
B. 📊 RSI Configuration:
📏 Length: Default 14 periods
📈 Source: Default close price (customizable)
📊 RSI MA Length: Default 365 periods
🔄 RSI MA Type: 6 options (EMA, SMA, RMA, WMA, VWMA, HMA)
C. 📢 Signal Display:
✅ Toggle for Bull/Bear crossover signals
📋 Table display showing current market bias
3. 🧮 Technical Calculations
A. 📈 RSI Calculation:
Standard RSI formula using ta.rsi()
Configurable source and period length
B. 📊 RSI Moving Average:
Customizable MA type applied to the RSI values
Serves as a dynamic signal line
Default 365-period EMA smooths long-term trends
C. 🔔 Signal Detection:
🟢 isBull_RSI: RSI > RSI_MA (bullish condition)
🔴 isBear_RSI: RSI < RSI_MA (bearish condition)
🟢 Bull: Crossover signal (RSI crosses above MA)
🔴 Bear: Crossunder signal (RSI crosses below MA)
4. 👁️ Visual Elements
A. 📉 Main Plots:
📊 RSI Line: Thick line (width 3) colored conditionally based on position relative to its MA
📈 RSI MA Line: Yellow line showing the smoothed RSI
🎯 50-Level Line: Dashed white reference line
B. 🎨 Fill Areas:
🟢 Overbought Zone : Filled between RSI and MA
🔴 Oversold Zone : Filled between RSI and MA
Colors vary based on selected theme
C. 🌈 Background Highlights:
Subtle background coloring on bullish/bearish crossover signals
D. 📋 Table Display:
Shows "⬆️ Bullish" or "⬇️ Bearish" with appropriate coloring
5. 🔔 Alert System
🟢 LONG Alert: Triggers when RSI > RSI_MA
🔴 SHORT Alert: Triggers when RSI < RSI_MA
Includes ticker symbol in alert message
🏁 Trading Logic
🎯 Primary Signals:
🟢 Bullish Setup:
📈 RSI crosses above its moving average
📊 RSI remains above MA (continuous bullish condition)
🎨 Visual: Green/theme bull colors, bullish fill areas
🔴 Bearish Setup:
📉 RSI crosses below its moving average
📊 RSI remains below MA (continuous bearish condition)
🎨 Visual: Red/theme bear colors, bearish fill areas
✨ Key Features:
📊 Trend Filter: The RSI MA (365-period) acts as a long-term trend filter
⚡ Momentum + Trend: Combines momentum (RSI) with trend (MA) for higher probability signals
👁️ Visual Clarity: Color-coded elements make market state immediately apparent
🛠️ Customizability: Multiple MA types and color schemes adapt to different trading styles
💻 Code Structure
The script is well-organized with clear sections:
🔧 MA function definition
⚙️ Input settings
🧮 Calculations
🎨 Color definitions
📊 Plotting
📋 Table display
🔔 Alert conditions
🎯 Best Use Cases
📈 Trend Following: In trending markets, signals align with the overall direction
🔄 Mean Reversion: In ranging markets, oversold/overbought fills indicate potential reversals
⏰ Multi-Timeframe Analysis: Works well on daily/weekly charts for long-term positioning
✅ Signal Confirmation: Can be combined with other indicators for entry/exit confirmation
🏆 Unique Advantages
🎯 Reduced Whipsaws: Long MA period (365) filters out noise
👁️ Clear Visual Hierarchy: Multiple visual layers convey information efficiently
💼 Professional Presentation: Clean, organized display suitable for sharing
🛠️ Flexible Configuration: Adaptable to different assets and timeframes
This is an enhanced Relative Strength Index (RSI) indicator for TradingView that combines traditional RSI analysis with a moving average overlay to generate more reliable trading signals ⚡
🧩 Core Components
1. ⚙️ Indicator Settings
2. 🎛️ Input Parameters
A. 🎨 Color Settings:
5 different color themes: 🎨 Classic, 🚀 Modern, 💪 Robust, 🌈 Accented, ⚫⚪ Monochrome
Each theme provides distinct bullish/bearish color pairs
B. 📊 RSI Configuration:
📏 Length: Default 14 periods
📈 Source: Default close price (customizable)
📊 RSI MA Length: Default 365 periods
🔄 RSI MA Type: 6 options (EMA, SMA, RMA, WMA, VWMA, HMA)
C. 📢 Signal Display:
✅ Toggle for Bull/Bear crossover signals
📋 Table display showing current market bias
3. 🧮 Technical Calculations
A. 📈 RSI Calculation:
Standard RSI formula using ta.rsi()
Configurable source and period length
B. 📊 RSI Moving Average:
Customizable MA type applied to the RSI values
Serves as a dynamic signal line
Default 365-period EMA smooths long-term trends
C. 🔔 Signal Detection:
🟢 isBull_RSI: RSI > RSI_MA (bullish condition)
🔴 isBear_RSI: RSI < RSI_MA (bearish condition)
🟢 Bull: Crossover signal (RSI crosses above MA)
🔴 Bear: Crossunder signal (RSI crosses below MA)
4. 👁️ Visual Elements
A. 📉 Main Plots:
📊 RSI Line: Thick line (width 3) colored conditionally based on position relative to its MA
📈 RSI MA Line: Yellow line showing the smoothed RSI
🎯 50-Level Line: Dashed white reference line
B. 🎨 Fill Areas:
🟢 Overbought Zone : Filled between RSI and MA
🔴 Oversold Zone : Filled between RSI and MA
Colors vary based on selected theme
C. 🌈 Background Highlights:
Subtle background coloring on bullish/bearish crossover signals
D. 📋 Table Display:
Shows "⬆️ Bullish" or "⬇️ Bearish" with appropriate coloring
5. 🔔 Alert System
🟢 LONG Alert: Triggers when RSI > RSI_MA
🔴 SHORT Alert: Triggers when RSI < RSI_MA
Includes ticker symbol in alert message
🏁 Trading Logic
🎯 Primary Signals:
🟢 Bullish Setup:
📈 RSI crosses above its moving average
📊 RSI remains above MA (continuous bullish condition)
🎨 Visual: Green/theme bull colors, bullish fill areas
🔴 Bearish Setup:
📉 RSI crosses below its moving average
📊 RSI remains below MA (continuous bearish condition)
🎨 Visual: Red/theme bear colors, bearish fill areas
✨ Key Features:
📊 Trend Filter: The RSI MA (365-period) acts as a long-term trend filter
⚡ Momentum + Trend: Combines momentum (RSI) with trend (MA) for higher probability signals
👁️ Visual Clarity: Color-coded elements make market state immediately apparent
🛠️ Customizability: Multiple MA types and color schemes adapt to different trading styles
💻 Code Structure
The script is well-organized with clear sections:
🔧 MA function definition
⚙️ Input settings
🧮 Calculations
🎨 Color definitions
📊 Plotting
📋 Table display
🔔 Alert conditions
🎯 Best Use Cases
📈 Trend Following: In trending markets, signals align with the overall direction
🔄 Mean Reversion: In ranging markets, oversold/overbought fills indicate potential reversals
⏰ Multi-Timeframe Analysis: Works well on daily/weekly charts for long-term positioning
✅ Signal Confirmation: Can be combined with other indicators for entry/exit confirmation
🏆 Unique Advantages
🎯 Reduced Whipsaws: Long MA period (365) filters out noise
👁️ Clear Visual Hierarchy: Multiple visual layers convey information efficiently
💼 Professional Presentation: Clean, organized display suitable for sharing
🛠️ Flexible Configuration: Adaptable to different assets and timeframes
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.