OPEN-SOURCE SCRIPT
RSI MA Cross + Divergence Signal (fixed)

🔹 Core Logic
RSI + Moving Average
The script calculates a standard RSI (default 14).
It then overlays a moving average (SMA/EMA/WMA, default 9).
When RSI crosses above its MA → bullish momentum.
When RSI crosses below its MA → bearish momentum.
Divergence Filter
Signals are only valid if there’s confirmed divergence:
Bullish divergence: Price makes a lower low, RSI makes a higher low.
Bearish divergence: Price makes a higher high, RSI makes a lower high.
Overbought / Oversold Filter
Optional extra:
Bullish signals only valid if RSI ≤ 30 (oversold).
Bearish signals only valid if RSI ≥ 70 (overbought).
This ensures signals happen in “stretched” conditions.
Risk & Trade Management
Entries taken only when all conditions align.
Exits can be managed with ATR stops, partial take-profits, breakeven moves, and trailing stops (we coded these in the strategy version).
Cooldown, session filters, and daily loss guard to keep risk tight.
🔹 Strengths
✅ High selectivity: Combining RSI cross + divergence + OB/OS means signals are rare but higher quality.
✅ Great at catching reversals: Divergence highlights where price may be running out of steam.
✅ Risk management baked in: ATR stops + partial exits smooth out equity curve.
✅ Works across markets: ES, FX, crypto — anywhere RSI divergences are respected.
✅ Flexible: You can loosen/tighten filters depending on aggressiveness.
🔹 Weaknesses
❌ Lag from pivots: Divergence only confirms after a few bars → you enter late sometimes.
❌ Choppy in ranges: In sideways markets, RSI divergences appear often and whipsaw.
❌ Filters reduce signals: With all filters ON (divergence + OB/OS + trend + session), signals can be very rare — may under-trade.
❌ Not standalone: Needs higher-timeframe context (trend, liquidity pools) to avoid counter-trend entries.
🔹 Best Ways to Trade It
Use Higher Timeframe Bias
Run the strategy on 15m/1H, but only trade in direction of higher timeframe trend (e.g., 4H EMA).
Example: If daily is bullish → only take bullish divergences.
Pair With Structure
Look for signals at key zones: HTF support/resistance, VWAP, or FVGs.
Divergence + RSI cross inside an FVG is a strong entry trigger.
Adjust OB/OS for Volatility
For crypto/FX: use 35/65 instead of 30/70 (markets trend harder).
For ES/S&P: 30/70 works fine.
Risk Management Is King
Use partial exits: take profit at 1R, trail rest.
Size by % of equity (we coded this into the strategy).
Avoid News Spikes
Divergences break down around CPI, NFP, Fed announcements — stay flat.
🔹 When It Shines
Trending markets that make extended pushes → clean divergences.
Reversal zones (oversold → bullish bounce, overbought → bearish fade).
Swing trading (15m–4H) — less noise than 1m/5m scalping.
🔹 When to Avoid
Low volatility chop → lots of false divergences.
During high-impact news → RSI swings wildly.
In strong one-way trends without pullbacks — divergence keeps calling tops/bottoms too early.
✅ Summary:
This is a reversal-focused RSI divergence strategy with strict filters. It’s powerful when combined with higher-timeframe bias + structure confluence, but weak if traded blindly in choppy or news-driven conditions. Best to treat it as a precision entry trigger, not a full system — layer it on top of your FVG/ORB framework for maximum edge.
RSI + Moving Average
The script calculates a standard RSI (default 14).
It then overlays a moving average (SMA/EMA/WMA, default 9).
When RSI crosses above its MA → bullish momentum.
When RSI crosses below its MA → bearish momentum.
Divergence Filter
Signals are only valid if there’s confirmed divergence:
Bullish divergence: Price makes a lower low, RSI makes a higher low.
Bearish divergence: Price makes a higher high, RSI makes a lower high.
Overbought / Oversold Filter
Optional extra:
Bullish signals only valid if RSI ≤ 30 (oversold).
Bearish signals only valid if RSI ≥ 70 (overbought).
This ensures signals happen in “stretched” conditions.
Risk & Trade Management
Entries taken only when all conditions align.
Exits can be managed with ATR stops, partial take-profits, breakeven moves, and trailing stops (we coded these in the strategy version).
Cooldown, session filters, and daily loss guard to keep risk tight.
🔹 Strengths
✅ High selectivity: Combining RSI cross + divergence + OB/OS means signals are rare but higher quality.
✅ Great at catching reversals: Divergence highlights where price may be running out of steam.
✅ Risk management baked in: ATR stops + partial exits smooth out equity curve.
✅ Works across markets: ES, FX, crypto — anywhere RSI divergences are respected.
✅ Flexible: You can loosen/tighten filters depending on aggressiveness.
🔹 Weaknesses
❌ Lag from pivots: Divergence only confirms after a few bars → you enter late sometimes.
❌ Choppy in ranges: In sideways markets, RSI divergences appear often and whipsaw.
❌ Filters reduce signals: With all filters ON (divergence + OB/OS + trend + session), signals can be very rare — may under-trade.
❌ Not standalone: Needs higher-timeframe context (trend, liquidity pools) to avoid counter-trend entries.
🔹 Best Ways to Trade It
Use Higher Timeframe Bias
Run the strategy on 15m/1H, but only trade in direction of higher timeframe trend (e.g., 4H EMA).
Example: If daily is bullish → only take bullish divergences.
Pair With Structure
Look for signals at key zones: HTF support/resistance, VWAP, or FVGs.
Divergence + RSI cross inside an FVG is a strong entry trigger.
Adjust OB/OS for Volatility
For crypto/FX: use 35/65 instead of 30/70 (markets trend harder).
For ES/S&P: 30/70 works fine.
Risk Management Is King
Use partial exits: take profit at 1R, trail rest.
Size by % of equity (we coded this into the strategy).
Avoid News Spikes
Divergences break down around CPI, NFP, Fed announcements — stay flat.
🔹 When It Shines
Trending markets that make extended pushes → clean divergences.
Reversal zones (oversold → bullish bounce, overbought → bearish fade).
Swing trading (15m–4H) — less noise than 1m/5m scalping.
🔹 When to Avoid
Low volatility chop → lots of false divergences.
During high-impact news → RSI swings wildly.
In strong one-way trends without pullbacks — divergence keeps calling tops/bottoms too early.
✅ Summary:
This is a reversal-focused RSI divergence strategy with strict filters. It’s powerful when combined with higher-timeframe bias + structure confluence, but weak if traded blindly in choppy or news-driven conditions. Best to treat it as a precision entry trigger, not a full system — layer it on top of your FVG/ORB framework for maximum edge.
오픈 소스 스크립트
진정한 트레이딩뷰 정신에 따라 이 스크립트 작성자는 트레이더가 기능을 검토하고 검증할 수 있도록 오픈소스로 공개했습니다. 작성자에게 찬사를 보냅니다! 무료로 사용할 수 있지만 코드를 다시 게시할 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.
오픈 소스 스크립트
진정한 트레이딩뷰 정신에 따라 이 스크립트 작성자는 트레이더가 기능을 검토하고 검증할 수 있도록 오픈소스로 공개했습니다. 작성자에게 찬사를 보냅니다! 무료로 사용할 수 있지만 코드를 다시 게시할 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.