OPEN-SOURCE SCRIPT
Telah dikemas kini

RSI MA Alert on close (One-Shot w/ Reset at 50)

54
🧠🧠 Overview
This script combines the Relative Strength Index (RSI) with a Moving Average (MA) of the RSI to generate "one-shot" alerts for potential overbought or oversold conditions. After triggering an alert, it prevents duplicate signals until the RSI MA resets by crossing the 50 level, helping reduce noise and false signals.

🔒 All signals trigger only after the candle closes, ensuring confirmation and reducing premature alerts during intrabar movement.

⚙️ How It Works
📊 Core Logic
RSI & MA Calculation:

Calculates the RSI using your chosen length.

Applies a Moving Average (SMA or EMA) to the RSI to smooth the signal.

One-Shot Alert Mechanism:

Alerts are triggered only once per cycle when the RSI MA crosses the overbought or oversold threshold.

After an alert fires, it won’t fire again until the RSI MA resets by crossing back through the midpoint level (default: 50).

✅ Alerts only trigger on candle close, helping avoid false breakouts during live price action.

Reset System:

An overbought alert can only trigger if RSI MA first crosses below 50, then above the overbought level.

An oversold alert can only trigger if RSI MA first crosses above 50, then below the oversold level.

📈 Chart Display
Plots the RSI and its MA for visual analysis.

Dashed lines show overbought (default: 60) and oversold (default: 40) levels.

A dotted line marks the reset level (default: 50).

Visual markers ("OB" / "OS") appear when alerts are triggered.

🔔 Custom Alerts
Two customizable alerts are available:

RSI MA Crossed Above Overbought: Triggers after reset when RSI MA crosses above the overbought threshold.

RSI MA Crossed Below Oversold: Triggers after reset when RSI MA crosses below the oversold threshold.

🔄 Each alert triggers only once per reset cycle and only after a candle closes, ensuring reliability.

🛠️ Inputs
RSI Length

MA Length (on RSI)

MA Type: SMA or EMA

Overbought & Oversold Thresholds

Reset Threshold (usually 50)

Enable/Disable individual alerts

✅ Best Use Cases
Traders wanting cleaner RSI signals with fewer false positives.

Situations where signal confirmation is needed through a reset mechanism.

Ideal for trend-following or mean-reversion strategies with customizable tuning.

Nota Keluaran
Update to only show alert on candle close

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.