OPEN-SOURCE SCRIPT
eBacktesting - Learning: RSI Divergences

eBacktesting - Learning: RSI Divergences is meant to train your eye to spot when a trend is losing momentum before price fully turns.
How to study it (step-by-step)
1. Start with the trend
- First decide if price is generally trending up or down (higher highs / higher lows vs lower highs / lower lows).
- Divergences matter most after a trend has been running for a while.
2. Look for the “mismatch”
- Bearish divergence: price prints higher highs, but RSI prints lower highs.
- This often shows up near the end of a strong bullish run, when buyers are still pushing price up but with less momentum.
- Bullish divergence: price prints lower lows, but RSI prints higher lows.
- This can show up near the end of a bearish move, when selling pressure is fading.
3. Treat divergence as a warning, not an entry
- The key lesson: divergence often signals trend weakness, not an instant reversal.
- After a divergence appears, study what happens next: stalling, ranging, a pullback, or a full reversal.
4. Add simple confirmation
- Practice waiting for something obvious after the divergence:
a break of a small support/resistance level,
a shift in swing structure,
or a clear rejection candle from a key area.
- This helps you avoid taking every divergence as a trade signal.
5. Use it inside eBacktesting (best practice)
- Replay the chart and pause on each divergence mark.
- Log:
Where it happened (after a long run or in the middle of chop?),
Whether price stalled first or reversed immediately,
What confirmation appeared (if any),
The best “invalidation” idea (what would prove you wrong?).
- Over time you’ll see which divergences are meaningful for your market and session, and which ones are noise.
These indicators are built to pair perfectly with the eBacktesting extension, where traders can practice these concepts step-by-step. Backtesting concepts visually like this is one of the fastest ways to learn, build confidence, and improve trading performance.
Educational use only. Not financial advice.
How to study it (step-by-step)
1. Start with the trend
- First decide if price is generally trending up or down (higher highs / higher lows vs lower highs / lower lows).
- Divergences matter most after a trend has been running for a while.
2. Look for the “mismatch”
- Bearish divergence: price prints higher highs, but RSI prints lower highs.
- This often shows up near the end of a strong bullish run, when buyers are still pushing price up but with less momentum.
- Bullish divergence: price prints lower lows, but RSI prints higher lows.
- This can show up near the end of a bearish move, when selling pressure is fading.
3. Treat divergence as a warning, not an entry
- The key lesson: divergence often signals trend weakness, not an instant reversal.
- After a divergence appears, study what happens next: stalling, ranging, a pullback, or a full reversal.
4. Add simple confirmation
- Practice waiting for something obvious after the divergence:
a break of a small support/resistance level,
a shift in swing structure,
or a clear rejection candle from a key area.
- This helps you avoid taking every divergence as a trade signal.
5. Use it inside eBacktesting (best practice)
- Replay the chart and pause on each divergence mark.
- Log:
Where it happened (after a long run or in the middle of chop?),
Whether price stalled first or reversed immediately,
What confirmation appeared (if any),
The best “invalidation” idea (what would prove you wrong?).
- Over time you’ll see which divergences are meaningful for your market and session, and which ones are noise.
These indicators are built to pair perfectly with the eBacktesting extension, where traders can practice these concepts step-by-step. Backtesting concepts visually like this is one of the fastest ways to learn, build confidence, and improve trading performance.
Educational use only. Not financial advice.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
eBacktesting.com
--------
Check out the most complete backtesting suite integrated on TradingView!
Join our free Discord group for more info, Q&A, and education:
discord.gg/kJSmwSxBpW
--------
Check out the most complete backtesting suite integrated on TradingView!
Join our free Discord group for more info, Q&A, and education:
discord.gg/kJSmwSxBpW
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.
Open-source script
In true TradingView spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
eBacktesting.com
--------
Check out the most complete backtesting suite integrated on TradingView!
Join our free Discord group for more info, Q&A, and education:
discord.gg/kJSmwSxBpW
--------
Check out the most complete backtesting suite integrated on TradingView!
Join our free Discord group for more info, Q&A, and education:
discord.gg/kJSmwSxBpW
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.