OPEN-SOURCE SCRIPT
umbul98-Doji RSI with Divergence

🔹 1. Basic Logic
This indicator combines two things:
🕯 Doji candlestick pattern → Indecision/reversal signal
📈 RSI (Relative Strength Index) → Overbought/oversold condition
👉 So instead of a Doji alone:
It produces a more filtered signal with “Doji + RSI position”.
🔹 2. How is a Doji Detected?
The indicator defines a classic Doji as follows:
The candle body is very small.
The upper and lower wicks are close together (balance exists).
In the code:
Body = less than 5% of the total range.
Wicks are approximately equal.
👉 This allows:
True indecision candles are filtered out (junk Dojis are eliminated).
🔹 3. RSI Integration (The most critical part)
It divides Dojis into 3 categories according to RSI:
🟢 1. Lower Boundary Doji (RSI ≤ 30)
Oversold zone
Doji = selling pressure may be weakening
👉 Interpretation: Possibility of an uptrend
🔴 2. Upper Boundary Doji (RSI ≥ 70)
Overbought zone
Doji = buying pressure may be weakening
👉 Interpretation: Possibility of a downtrend
⚪ 3. Neutral Doji (30 < (RSI < 70)
Uncertain market
👉 Comment: Wait / direction unclear
🔹 What does the 4th chart show?
✔️ "D" label on the candle
Marks the bar where a Doji is forming
Meaning changes according to color:
🟢 Green → Possible upward reversal
🔴 Red → Possible downward reversal
⚪ Gray → Undecided
✔️ Background Colors
Green → RSI low + Doji
Red → RSI high + Doji
Gray → Neutral
👉 This is a very good visual filter 👍
✔️ Tooltip (explanation when hovered over)
Each label has a comment:
“May show an upward trend”
“May show a downward trend”
✔️ Alarm System
There are 3 different alarms:
RSI ≤ 30 + Doji
RSI ≥ 70 + Doji
Neutral Doji
👉 Can be linked to TradingView alarm
🔹 5. Purpose of Use
This indicator is especially useful for: Ideal:
✅ Bottom capture (reversal)
RSI below 30 + Doji → strong signal
✅ Top capture
RSI above 70 + Doji → selling opportunity
✅ Fake signal filtering
Confirmation with RSI instead of Doji alone
🔹 6. Strengths
✔ Noise-reduced Doji detection
✔ Smart filtering with RSI
✔ Visually very clear (label + background)
✔ Alarm supported
✔ Simple but effective strategy infrastructure
🔹 7. Weaknesses (Important ⚠️)
❗ If used alone:
Can mislead in trend market
Constantly generates Doji (especially low timeframe)
👉 Therefore, best use:
With EMA trend filter
With support/resistance
Consolidation breakout island
This indicator combines two things:
🕯 Doji candlestick pattern → Indecision/reversal signal
📈 RSI (Relative Strength Index) → Overbought/oversold condition
👉 So instead of a Doji alone:
It produces a more filtered signal with “Doji + RSI position”.
🔹 2. How is a Doji Detected?
The indicator defines a classic Doji as follows:
The candle body is very small.
The upper and lower wicks are close together (balance exists).
In the code:
Body = less than 5% of the total range.
Wicks are approximately equal.
👉 This allows:
True indecision candles are filtered out (junk Dojis are eliminated).
🔹 3. RSI Integration (The most critical part)
It divides Dojis into 3 categories according to RSI:
🟢 1. Lower Boundary Doji (RSI ≤ 30)
Oversold zone
Doji = selling pressure may be weakening
👉 Interpretation: Possibility of an uptrend
🔴 2. Upper Boundary Doji (RSI ≥ 70)
Overbought zone
Doji = buying pressure may be weakening
👉 Interpretation: Possibility of a downtrend
⚪ 3. Neutral Doji (30 < (RSI < 70)
Uncertain market
👉 Comment: Wait / direction unclear
🔹 What does the 4th chart show?
✔️ "D" label on the candle
Marks the bar where a Doji is forming
Meaning changes according to color:
🟢 Green → Possible upward reversal
🔴 Red → Possible downward reversal
⚪ Gray → Undecided
✔️ Background Colors
Green → RSI low + Doji
Red → RSI high + Doji
Gray → Neutral
👉 This is a very good visual filter 👍
✔️ Tooltip (explanation when hovered over)
Each label has a comment:
“May show an upward trend”
“May show a downward trend”
✔️ Alarm System
There are 3 different alarms:
RSI ≤ 30 + Doji
RSI ≥ 70 + Doji
Neutral Doji
👉 Can be linked to TradingView alarm
🔹 5. Purpose of Use
This indicator is especially useful for: Ideal:
✅ Bottom capture (reversal)
RSI below 30 + Doji → strong signal
✅ Top capture
RSI above 70 + Doji → selling opportunity
✅ Fake signal filtering
Confirmation with RSI instead of Doji alone
🔹 6. Strengths
✔ Noise-reduced Doji detection
✔ Smart filtering with RSI
✔ Visually very clear (label + background)
✔ Alarm supported
✔ Simple but effective strategy infrastructure
🔹 7. Weaknesses (Important ⚠️)
❗ If used alone:
Can mislead in trend market
Constantly generates Doji (especially low timeframe)
👉 Therefore, best use:
With EMA trend filter
With support/resistance
Consolidation breakout island
Skrip sumber terbuka
Dalam semangat TradingView sebenar, pencipta skrip ini telah menjadikannya sumber terbuka, jadi pedagang boleh menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupuan anda boleh menggunakan secara percuma, ingat bahawa penerbitan semula kod ini tertakluk kepada Peraturan Dalaman.
Penafian
Maklumat dan penerbitan adalah tidak bertujuan, dan tidak membentuk, nasihat atau cadangan kewangan, pelaburan, dagangan atau jenis lain yang diberikan atau disahkan oleh TradingView. Baca lebih dalam Terma Penggunaan.
Skrip sumber terbuka
Dalam semangat TradingView sebenar, pencipta skrip ini telah menjadikannya sumber terbuka, jadi pedagang boleh menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupuan anda boleh menggunakan secara percuma, ingat bahawa penerbitan semula kod ini tertakluk kepada Peraturan Dalaman.
Penafian
Maklumat dan penerbitan adalah tidak bertujuan, dan tidak membentuk, nasihat atau cadangan kewangan, pelaburan, dagangan atau jenis lain yang diberikan atau disahkan oleh TradingView. Baca lebih dalam Terma Penggunaan.