PROTECTED SOURCE SCRIPT
Telah dikemas kini

EMA Cloud with Custom MAs and RSI [deepakks444]

96
This all-in-one technical analysis tool merges an EMA Cloud, customizable dual moving averages (MA1 & MA2), and an advanced RSI oscillator with divergence detection, smoothing, and alerts.

Designed for traders who rely on trend direction, momentum, and reversal confluence, this indicator helps filter high-probability setups and reduces the need to juggle multiple indicators on the chart.

🔍 Components and Features
🔸 1. EMA Cloud (Trend Filter)
A lightweight 3-period EMA manually calculated using exponential smoothing.

Two EMAs: One tracking highs and one tracking lows.

Creates a "cloud" between them to visually represent short-term trend direction.

Cloud color logic:

🟢 Green: Price is bullish, staying above the EMA cloud.

🔴 Red: Price is bearish, below the EMA cloud.

🟡 Yellow: Price is indecisive or in consolidation.

Why it's useful:
The EMA Cloud helps identify the immediate short-term bias of the market. It quickly reacts to price and gives a clear visual guide for trend-following or pullback trades.

🔸 2. Custom Moving Averages (MA1 & MA2)
Both MA1 and MA2 are user-configurable in type, length, and price source.

Supported types include:

SMA, EMA, WMA, HMA, RMA, VWMA.

Color logic:

🟩 Green: MA1 is below MA2 (bullish alignment).

🟥 Red: MA1 is above MA2 (bearish alignment).

Why include this?
MA crossovers are a classic way to determine medium/long-term trend shifts or confirm trend continuation. The flexibility allows users to tailor them to suit any strategy—from mean reversion to trend-following.

🔸 3. RSI Oscillator with Enhancements
This is more than a basic RSI—it's been expanded to become a momentum engine and divergence detector, complete with alerting and smoothing options.

Main features:

✅ Customizable RSI Source & Length
✅ Colored RSI Zones:

RSI > 60 → Overbought strength zone (green background).

RSI < 40 → Oversold weakness zone (red background).

Neutral background in between.

✅ Smoothing Options:

Apply additional MA smoothing to RSI: SMA, EMA, WMA, RMA, VWMA, or even SMA + Bollinger Bands.

Visualizes volatility around RSI for breakout/reversal analysis.

✅ RSI Alerts:

Alert when RSI crosses above 60 → potential bullish momentum.

Alert when RSI crosses below 40 → potential bearish momentum.

✅ Divergence Detection (Optional):

Bullish Divergence: Price makes lower low while RSI makes higher low → Possible reversal up.

Bearish Divergence: Price makes higher high while RSI makes lower high → Possible reversal down.

Marks divergence using “Bull” and “Bear” labels directly on the RSI pane.

Why enhance RSI?
The RSI is a cornerstone of momentum trading. By adding zone shading, volatility overlays, and divergence detection, traders can better assess:

Whether a trend is strong or weakening.

Whether to enter on continuation or wait for reversal.

Spot early signs of price turning points using divergence patterns.

🤝 Why Merge These Three Systems?
Combining EMA Cloud + MAs + RSI in a single tool allows traders to:

Avoid conflicting signals by seeing multiple confirmations in one view.

Reduce chart clutter by replacing multiple indicators with one efficient visual system.

Get trend, momentum, and reversal analysis all-in-one:

EMA Cloud = short-term trend.

MA1/MA2 = medium-term trend & crossover confirmation.

RSI = momentum extremes, breakout confirmation, or divergence reversal zones.

🔔 Built-in Alerts
RSI crosses above 60 → Potential buy signal.

RSI crosses below 40 → Potential sell signal.

These alerts can be used to automate notifications, integrate with webhook systems, or trigger manual reviews.

⚠️ Disclaimer
This script is provided for educational and informational purposes only. It is not financial advice, and past performance is not indicative of future results. Always use proper risk management and verify signals with your own analysis before trading.
Nota Keluaran
Added additional input EMA to define signals are based upon.

Entry Rules:

Short Entry (Sell):

Conditions:
RSI peaks above 60, then crosses below its MA.
Current candle closes below the 9EMA.
9EMA slope is steeply downward (>35 degrees).
Action: Enter short position with stop-loss above recent high and take-profit based on 9EMA angle.

Long Entry (Buy):

Conditions:
RSI dips below 40, then crosses above its MA.
Current candle closes above the 9EMA.
9EMA slope is steeply upward (>35 degrees).
Action: Enter long position with stop-loss below recent low and take-profit based on 9EMA angle.
Exit Rules:

Exit trade when price approaches resistance/support or achieves take-profit target.
Exit or prepare for reversal when price crosses 9EMA in the opposite direction.
Consider exiting if RSI shows divergence or approaches overbought/oversold levels.
Risk Management:

Risk no more than 1–2% of account equity per trade.
Confirm 9EMA relationship and RSI MA crossing with candle close.
Avoid trading in choppy markets or when 9EMA angle is shallow (<35 degrees).
Example Trades:

Short Trade: Enter "S" at 12:30 PM, price ~3,390, exit at ~3,375.
Long Trade: Enter "L" at 02:30 PM, price ~3,385, exit at ~3,395–3,400.
Advantages:

High-probability entries combining RSI momentum, 9EMA position, and steep angle.
Clear signal management with "L" and "S" restrictions.
Adaptable to volatile assets like gold.
Risks and Mitigations:

False breakouts: Use confirmation and stop-losses.
Choppy markets: Avoid trading during consolidation.
Lag: Consider shorter periods or additional filters.
Implementation Notes:

Use updated buy/sell signal definitions with cloud color.
Add visual angle indicator for 9EMA if possible.
Backtest to optimize take-profit and stop-loss levels.
Nota Keluaran
Important Note on Alerts:
This script uses an RSI length (and its MA) defaulted to 9.
Due to a limitation in TradingView’s alert system, alerts will only trigger based on the RSI length hardcoded in the script, not the length selected via the input menu.
If you change the RSI length from the input settings (e.g., to 14), the chart will reflect the new calculation, but alerts will still behave as if the length is 9, unless the script itself is updated and re-saved with the new length.
This is a known limitation in TradingView.

The issue is not with the RSI logic itself, but with how TradingView handles alerts when the user changes input values. Specifically:

The alert logic uses the hardcoded/default length set in the script at the time the alert is created.

If the user selects a different RSI length via the input menu (without changing the script itself), the alert will still operate based on the script’s original length, not the user’s selected input.

So even though the chart visually reflects the new RSI length, alerts won’t align with those visual signals unless the script is re-saved with that length hardcoded.
Nota Keluaran
Signals will only appear after 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.