Divergencedetection
📊 Divergence Cheat SheetDivergences, whether bullish or bearish in nature, have been classified according to their levels of strength. The strongest divergences are Class A divergences; exhibiting less strength are Class B divergences; and the weakest divergences are Class C. The best trading opportunities are indicated by Class A divergences, while Class B and C divergences represent choppy market action and should generally be ignored.
🔷 Class A bearish divergences occur when prices rise to a new high but the oscillator can only muster a high that is lower than exhibited on a previous rally. Class A bearish divergences often signal a sharp and significant reversal toward a downtrend. Class A bullish divergences occur when prices reach a new low but an oscillator reaches a higher bottom than it reached during its previous decline. Class A bullish divergences are often the best signals of an impending sharp rally.
🔷 Class B bearish divergences are illustrated by prices making a double top, with an oscillator tracing a lower second top. Class B bullish divergences occur when prices trace a double bottom, with an oscillator tracing a higher second bottom.
🔷 Class C bearish divergences occur when prices rise to a new high but an indicator stops at the very same level it reached during the previous rally. Class C bullish divergences occur when prices fall to a new low while the indicator traces a double bottom. Class C divergences are most indicative of market stagnation – bulls and bears are becoming neither stronger nor weaker.
👤 @algobuddy
📅 Daily Ideas about market update, psychology & indicators
❤️ If you appreciate our work, please like, comment and follow ❤️
AUDUSD | Bearish DivergenceThis idea is a continuation of the previous idea, which is listed below,make sure you've seen it!
In this idea, bearish divergence are clearly seen in 1 hour time frame, of course this is our chance to take short, but there are conditions to ensure that this divergence is valid,there are two confirmations that you can choose or you can choose both
Option 1
The first option is the trend line, this is the most basic and simple confirmation, the way to use it is when the price has crossed the trend line, then that's when we can enter
Option 2
For the second option, this option was chosen because the area is a strong area, if the price manages to break through this strong area, then it is a good time for us to enter
How about combining the two options?
To combine the two, we need to wait for these two options to have been breached. the conclusion is that if only one option has been penetrated (while the other has not) then we have to wait for the other option to be penetrated by the price
Thank you for taking your time to read, it makes me more synergistic
Stay tune!
Hidden bearish divergence spotted on EURUSD, SELL OPPORTUNITYHello traders, welcome back to my divergence trading idea. Today, EURUSD form a Hidden Bearish Divergence on the H4 TF as price had made a Lower High (LH) while the RSI Indicator had made a Higher High indicating price can move further down as the price is in a downtrend. Also on the H4 TF, price rejected the recent high trendline around 1.11203 which could mean more sellers are coming in.
A trade entry can be made around 1.10285 with TP placed around 1.08461 and SL around 1.10863.
The RRR is 1:3.21 making it a good trade
Regular Bullish Divergence spotted on GBPUSD H4 and H1 TFHello traders. As market open again tomorrow, here is a trade idea on GBPUSD. on the H4 and H1, the price makes a lower low while the RSI indicator makes a higher low, forming a regular bullish divergence as seen on the chart.
Also a spinning top was formed on H4 TF which could indicate bears are exhausted.
Thus, we can make our entries around 1.32331 (or lower), how SL (from H4 TF) can be placed around 1.31858 and our TP (from H4 TF) can be placed around 1.34112. The RRR is 1:3.7, making it a profitable trade.
NOTE: This is not a financial advice
Hidden Bullish Divergence spotted on USDJPY H1 TF. Long positionA hidden bullish divergence has been spotted on USDJPY H1 TF as price made a HL and the RSI indicator made a LL.
Also, on the daily TF, we can see price is in an uptrend as price keep respecting the 100 day EMA. However, on the H4 TF, price has formed a double top which might indicate price shooting down, therefore we shall use a tight stop.
We will go long
entries can be made around 114.900 or lower, SL can be placed around 114.617.
For day traders, it is advised to place TP around 115.597 (RRR of 1:2.4)
For swing traders, it is advised to place TP around 115.748 (RRR of 1:3.0)
This is a risky trade but with high reward
Note: This is not a financial advice.
Hidden Bullish Divergence on USDCHF H4 TimeframeFollowing the recent strong bearish movement USDCHF have formed a hidden bullish divergence on the H4 and H1 TF. This might indicate bullish run will soon start. For now, price is testing the recent swing low (HL). If this level should hold, then we expect a break above 0.91221 which will further confirm the bullish run. Our SL is tight, placed at the recent low (0.91492) while our TP is placed around the next resistance (0.92610) giving it a 1:3.8 RR
AUDUSD REGULAR BULLISH DIVERGENCE FORMED ON H1 TF. A regular bullish divergence was formed on AUDUSD H1 TF between January 01- January 7 2022 signifying price moving to the upside is imminent. The price form a lower low (LL) while the Indicator (RSI) was making a higher low (HL). Also on the H1 TF, it seems a new uptrend is forming gradually and the prior downtrend has ended. A break above 0.71832 (recent resistance) will confirm that the pair is in uptrend.
The easiest way to use divergences in your own Pine strategiesDetecting divergences in a Pine indicator / strategy is easy.
You simply have to compare the pivot lows and the pivot highs on the price and the oscillator, and if you can identify a difference between the last & previous pivots made on the price and the oscillator, you have likely found a divergence.
Using this theory, here is an example how you would detect a Regular Bearish divergence:
While the theory of divergence detection is simple, more often than not, things go wrong (the divergence indicator used in the example below is TradingView's built-in Divergence Indicator ):
Would you identify this as a divergence? If not, why not? Is it because the divergence line is slicing through the candles? Or because the line is slicing through the oscillator? Or something else?
Wouldn't it be great if somehow you could filter out invalid divergences from code, such as this one?
We at Whitebox Software were wondering about the same thing, and decided to find a solution to this problem. This is when we realised that while detecting divergences is easy, detecting valid divergences is hard...
After several months in development, we are proud to present to you our divergence indicator called The Divergent .
The Divergent is an advanced divergence indicator with over 2500 lines of Pine Script, exposing over 30 different configuration options, including 9 built-in oscillators, to allow you to tweak every aspect of divergence detection to perfection.
For example, the Line of Sight™ filter in The Divergent would have easily filtered out this invalid divergence above. The Line of Sight™ filter will notice any interruption to the divergence line connecting the price or the oscillator, and will treat the divergence as invalid.
This filter is one of many, which has been created to reduce the false positive detections to a minimum. (In later publications, we will discuss each and every filter in detail).
Alright, so The Divergent knows how to detect accurate divergences, but how is it going to help you detect divergences in your own Pine strategy?
The Divergent is not simply a divergence indicator - it can also emit divergence signals * which you can catch and process in your own strategy. You can think of The Divergent being a DaaS ( D ivergences a s a S ervice)!
* Please note, that divergence signals is a Pro only feature.
To use the signals, simply place The Divergent onto the same chart you have your strategy on, import "The Divergent Library" into your code, link your strategy to The Divergent using a "source" input, and act on the signals produced by The Divergent !
Here is a simple strategy which incorporates divergence signals produced by The Divergent in its entry condition. The strategy will only open a position, if the moving average cross is preceded by a regular bullish or bearish divergence (depending on the direction of the cross):
//@version=5
strategy("My Strategy with divergences", overlay=true, margin_long=100, margin_short=100)
import WhiteboxSoftware/TheDivergentLibrary/1 as tdl
float divSignal = input.source(title = "The Divergent Link", defval = close)
var bool tdlContext = tdl.init(divSignal, displayLinkStatus = true, debug = false)
// `divergence` can be one of the following values:
// na → No divergence was detected
// 1 → Regular Bull
// 2 → Regular Bull early
// 3 → Hidden Bull
// 4 → Hidden Bull early
// 5 → Regular Bear
// 6 → Regular Bear early
// 7 → Hidden Bear
// 8 → Hidden Bear early
//
// priceStart is the bar_index of the starting point of the divergence line drawn on price
// priceEnd is the bar_index of the ending point of the divergence line drawn on price
//
// oscStart is the bar_index of the starting point of the divergence line drawn on oscillator
// oscEnd is the bar_index of the ending point of the divergence line drawn on oscillator
= tdl.processSignal(divSignal)
bool regularBullSignalledRecently = ta.barssince(divergence == 1) < 10
bool regularBearSignalledRecently = ta.barssince(divergence == 5) < 10
float slowSma = ta_sma(close, 28)
float fastSma = ta_sma(close, 14)
longCondition = ta.crossover(fastSma, slowSma) and regularBullSignalledRecently
if (barstate.isconfirmed and longCondition and strategy.position_size == 0)
strategy.entry("Enter Long", strategy.long)
strategy.exit("Exit Long", "Enter Long", limit = close * 1.04, stop = close * 0.98)
shortCondition = ta.crossunder(fastSma, slowSma) and regularBearSignalledRecently
if (barstate.isconfirmed and shortCondition and strategy.position_size == 0)
strategy.entry("Enter Short", strategy.short)
strategy.exit("Exit Short", "Enter Short", limit = close * 0.96, stop = close * 1.02)
plot(slowSma, color = color.white)
plot(fastSma, color = color.orange)
One important thing to note, is that TradingView limits the number of "source" inputs you can use in an indicator / strategy to 1, so the source input linking your strategy and The Divergent is the only source input you can have in your strategy. There is a work around this limitation though. Simply convert the other source inputs to have a string type, and use a dropdown to provide the various sources:
string mySource = input.string("My source", defval = "close", options = )
float sourceValue = switch mySource
"close" => close
"open" => open
"high" => high
"low" => low
=> na
---
This is where we are going to wrap up this article.
We hope you will find the signals produced by The Divergent a useful addition in your own strategies!
For more info on the The Divergent (Free) and The Divergent (Pro) indicators please see the linked pages.
If you have any questions, don't hesitate to reach out to us either via our website or via the comment section below.
If you found value in this article please give it a thumbs up!
Thank you!