How To Trade Divergence
Divergence simply means separation.. When two similar things things---get separated and start going different directions, you have to consider which direction to follow. That's exactly the concept of divergence. When trading, and you spot a divergence, you want to be sure to understand what they are trying to tell you. In this video, I explain the concept of divergences, how to trade them and what to do when you sight one. Be sure to like, follow and comment.
I want to see those div trades!
Divergence
A Deep Dive Into The MACD1. Introduction
The Moving Average Convergence Divergence (MACD) indicator created by Gerald Appel in 1979 (1) is part of the pantheon of technical indicators, being one of the most used and influential ever created. The popularity of the MACD allowed further studies and more varied applications of the indicator, from signal processing in neuroscience (2), prediction of hospitalizations (3)...etc.
In this post, we will highlight extensive details, calculations, and usages of this legendary indicator. If you wanted to go beyond what you learned about the MACD, then this post is for you.
Note that some contents of this post can be complex and might not suit certain readers, feel free to skip the sections of your choice.
2. Details
This oscillator returns 3 time-series, the MACD, obtained from the difference between two exponential moving averages of different periods, a signal line, obtained from the exponential moving average of the MACD, and a histogram obtained from the difference between the MACD and the signal line.
Each MACD component allows evaluating the current market trend direction, momentum, and acceleration. Many traders believe the amount of information the MACD can return is sufficient to be used as a standalone for both trend-following and contrarian trading.
In terms of digital signal processing, the MACD can be classified as an infinite impulse response (IIR) bandpass filter, filtering out both lower and higher frequency components of a signal, thus having the ability to both detrend and smooth. The MACD filter satisfies the conditions for being a discreet time linear time-invariant (DLTI) system, it is linear and time-invariant:
macd_(a + b) = macd_(a) + macd_(b) -> Additivity
K × macd_(x) = macd_(K × x) -> Homogeneity
macd_(x ) = macd_(x) -> Time Invariance
3. Calculation
The MACD oscillator is obtained from the difference of two exponential moving averages (ExpMA), one using a faster period (often 12) and one using a slower period (often 26).
MACD_ = ExpMA(price,fast) - ExpMA(price,slow)
We can also obtain the MACD from the following difference equation:
y = (price - price ) × g + ((1 - a1) + (1 - a2)) × y - (1 - a1) × (1 - a2) × y
where a1 is the smoothing constant of the fast ExpMA, a2 the smoothing constant of the slow ExpMA, and g is the gain constant obtained from the difference between the smoothing constant of the two ExpMA's:
g = a1 - a2
= 2/(fast+1) - 2/(slow+1)
4. Impulse Response
The impulse response of the MACD is the result obtained by applying the MACD to a unit impulse signal, given by the Kronecker delta function d .
d = 1 if t = 0, else 0
The impulse response fully describes the properties of the MACD and can be obtained from the difference between the impulse response of two ema's with periods fast and slow .
The impulse response of an exponential moving average h(ExpMA) over time t with smoothing constant a is given by:
h(ExpMA) = a × (1 - a)^t
As such for the impulse response of the MACD h(MACD) over time t we obtain:
h(MACD_) = a1 × (1 - a1)^t - a2 × (1 - a2)^t
Like with an exponential moving average, the impulse response of the MACD does not become steady, instead continuing indefinitely, hence why it is classified as an infinite impulse response filter.
5. Frequency Response
The frequency response of filters allows us to determine how they affect the frequency content of a signal. The frequency response can be directly obtained from the discrete-time Fourier transform (DTFT) of the impulse response, which for the MACD returns:
H(e^iw) = SUM h × e^-iwn, for n = 0 to ∞
= SUM (a1 × (1 - a1)^n - a2 × (1 - a2)^n) × e^-iwn
with w = 2 × pi × f . The infinite sum makes its direct computation infeasible.
It is generally more common to evaluate the filter transfer function H(e^iw) obtained from the Z transform given by:
A(iw) = b + b × z^-iw + ... + b × z^-iwP
-------------------------------------------------
B(iw) = a + a × z^-iw + ... + a × z^-iwQ
With feed-forward coefficient b and feedback coefficients a . This transfer function assumes a filter of the form:
y = SUM b × x - SUM a × y , for p = 0 to P & for q = 1 to Q
This is the reverse ordering used by the MACD difference equation previously described, as such the MACD transfer function is given by:
g + -g × z^-iw
----------------------------------------------------------
1 + × z^-iw + × z^-iw2
The frequency response is then obtained by evaluating the above transfer function for z = e .
5.1 Magnitude Response
The magnitude response describes how a filter attenuates the amplitude of the frequencies composing a signal. It is obtained from the absolute value of the transfer function |H(e^iw)| , that is:
|H(e^iw)| = sqrt(Real ^2 + Imag ^2)
For the MACD we obtain the closed-form solution:
sqrt(g^2 × sin(2 × pi × f)^2 + (g - g × cos(2 × pi × f))^2)
|H(f)| = ----------------------------------------------------------------------------------------------------------
sqrt( ^2 + ^2)
with A1 = (a1 - 1) + (a2 - 1) and A2 = (a1 - 1) × (a2 - 1) .
In the previous figure we can see the magnitude response of the MACD using fast = 12 and slow = 26 . This magnitude response is asymmetric, we can see attenuation of lower frequency components, and a poor attenuation of high-frequency components.
The above figure shows various MACD magnitude responses for various configurations of the fast and slow settings. We can see on the left that a fast period closer to the slow period return magnitude responses with fatter tails as well as a decreasing resonant frequency (frequency where the filter returns the least attenuation), on the right, we can see how increasing the slow period returns a lower attenuation of the peak frequency.
6. Usage
The MACD has known a wide variety of usages amongst traders, extending from trend-following to contrarian methodologies.
The most basic usage of the MACD is given by evaluating the sign of the MACD, with a positive sign (fast ExpMa > slow ExpMA) indicating an uptrend and a negative sign (fast ExpMa < slow ExpMA) indicating a downtrend. We can see that this usage does not differ from the one given by a simple MA cross strategy. The user might also suffer from the excessive lag produced by this simplistic approach.
The strength of the indicator can come from the usage of the MACD with the signal line and histogram. A timelier approach would identify an uptrend when the MACD is above its signal line (histogram above 0) and a downtrend when the MACD is under the signal line (histogram under 0). This approach makes better use of the leading characteristic of the MACD oscillator, thus offering more predictive insights. However, an increment in timing does not come at no cost, with the more recurrent of whipsaw trades.
Notice in the image above how the usage of the MACD with the signal line allows for a faster trend detection compared to using the MACD alone. We can also see how this usage of the indicator is more sensitive to shorter-term price variations, inducing potential whipsaw trades. This is caused by the common tendencies that oscillators have to increase the presence of noise in an input series.
It is also possible to use a combination of both usages in order to avoid their disadvantages, for example opening trades based on the sign of the MACD while exiting trades when the MACD crosses the signal line. However, the main disadvantage of using the histogram can appear when the user must optimize indicator settings, with a usage based only on the MACD meaning that two settings would need to be optimized, while usage based on the histogram would mean optimizing three settings, which is computationally more expensive.
6.1 Divergences
Divergences are commonly used with oscillators. A divergence occurs when the price tops/bottoms and MACD tops/bottoms are negatively correlated. This can indicate a trend impulse of lower amplitude, which could highlight a potential reversal.
6.2 Fast > Slow Period MACD
The MACD already possesses some leading characteristics, allowing to anticipate turning points. However, the ability of the MACD to provide signals anticipating future trends mostly depends on the current market conditions, with certain price variations complicating the leading ability of the MACD. The predictive abilities of the MACD can be improved using a fast period higher than the slow period.
Assuming the user uses the histogram of the MACD, cyclical variations within a price trend will generally prove to be problematic if the signal length excessively delays the MACD. Inverting the fast and slow period can help signal early reversal, instead of suffering from the excessive delay introduced by the histogram.
The practice of inverting MACD fast and slow period was proposed by Ehlers (4), we can also see that optimizing MACD settings in mean reverting markets can tend to return fast periods higher than slow periods. We can see that such an approach is directed toward contrarian traders.
7. MACD Using Different Type of Moving Averages
The MACD uses exponential for the calculation of the fast, slow, and signal moving averages by default, however different types of moving averages can be used. The MACD would directly inherit the characteristics of the type of moving average used, thus improving characteristics such as reactivity and smoothness.
For example, certain users prefer using the simple moving average, returning slightly lower reactive MACD with a slightly higher degree of filtering.
Using low lag moving averages would return a very reactive MACD, with a histogram able to anticipate MACD turning points due to the ability of low lag moving averages to over/undershoot the input signal.
Notice in the above chart how the MACD based on the Hull moving average (bottom) is more reactive than a regular MACD (top) with equal settings. Also, notice how the signal line is able to exceed the MACD before the occurrence of its turning point.
However, it can be more interesting to use more than one kind of moving averages for the MACD calculation, using a type of moving average that is suitable for each MACD component. As such it would be more interesting to have a low lag moving average as fast-moving average, and a more classical one as slow and signal moving average.
References
(1) Appel, Gerald. "Technical Analysis Power Tools for Active Investors." Financial Times Prentice Hall. p. 166 (2005)
(2) Durantin, Gautier, et al. "Moving Average Convergence Divergence filter preprocessing for real-time event-related peak activity onset detection: Application to fNIRS signals." 2014 36th Annual International Conference of the IEEE Engineering in Medicine and Biology Society. IEEE, 2014.
(3) Zhang, Jufen, et al. "Predicting hospitalization due to worsening heart failure using daily weight measurement: analysis of the Trans‐European Network‐Home‐Care Management System (TEN‐HMS) study." European journal of heart failure 11.4 (2009): 420-427.
(4) Ehlers, John F. "The MACD Indicator Revisited." (1991).
One divergence indicator to rule them allGreetings Traders,
We are continuing with our (mini) series in which we break down the (seemingly endless) features of The Divergent indicator.
Today we are going to discuss the various oscillators The Divergent supports detecting divergences on.
In contrast to other divergence indicators on TradingView, The Divergent comes with oscillators built-in. This means you won't have to add it on top of other indicators on your chart; it is completely standalone. Why is that a good thing? It is because The Divergent respects your indicator quota - it will only use up a single slot on your chart.
The Divergent ships with the following oscillators:
MACD (Moving Average Convergence Divergence)
RSI (Relative Strength Index)
CMF (Chaikin Money Flow)
Stochastic RSI
MFI (Money Flow Index)
TCI (Trading Channel Index, aka. WaveTrend)
Balance of Power
CCI (Commodity Channel Index)
Awesome Oscillator
Each oscillator is fully customisable, allowing you to tweak them the way you desire. To choose another oscillator, simply open The Divergent 's settings panel, and select a different one from the list.
A further benefit of having the oscillators built into the indicator, is that it opens up the possibility to apply various filters to the detected divergences. For example, if you have the RSI selected, you can configure The Divergent to only signal those RSI divergences, that manifest under the oversold or above the overbought areas. These filters will be introduced in detail in future articles.
To learn more about The Divergent , please see the related ideas linked at the bottom.
If you liked this post, please don't forget to give it a thumbs up!
If you have any questions, please feel free to ask in the comments section below.
Thank you for your attention!
ULTIMATE MACD GUIDE - ENTRY'S AND EXITS 📚The Moving Average Convergence Divergence Oscillator , otherwise known as MACD, is one of the most powerful and dynamic indicators, if you can learn to use it properly.
It is easily one of my personal favorite indicators, and one that I currently use when scalping and day trading.
Now before we get into how the MACD works on a technical level, let’s first go over how the MACD helps us fundamentally.
We can break it’s benefits down into 4 categories - in which it allows us to measure and predict the following:
The strength of a pattern
The momentum of a movement
The direction of a movement
The duration of a movement
Let’s breakdown each of those
-The Strength Of A Pattern-
Have you ever seen price approach the outer limits of a wedge, channel, or support / resistance and wondered, cluelessly whether or not it would actually break through or end up rejecting?
The MACD allows us to predict the pressure behind a certain sentiment, and therefore predict the odds of that pattern completing successfully. (possible example)
-The Momentum Of A Movement-
When trading, especially day trading, it is important to have almost impeccable timing for entries and exits. The MACD allows us to see and predict current and future momentum. This is powerful, as it allows us to enter a long before the rest of the market has gone long (essentially entering a long before the market pumps.)
This increases our profit/loss ratio - therefore decreasing risk and allowing for more sturdy stop losses.
-The Direction Of A Movement-
This one is quite obvious when looking at the MACD, but without the indicator, it can sometimes be quite difficult to even see which way the market is trending (periods of high consolidation for instance)
By utilizing the MACD on multiple time frames, we can have a glimpse of where the market is headed, even if it is unknown on the smaller time frames. (the opposite is also true, when the higher time frames are in periods of high consolidation, we can take a look at the lower time frames to get an idea of where it is heading)
-The Duration Of A Movement-
As mentioned previously, it is extremely important as a day trader to have very accurate entries and exits. Ironically, one of the most difficult things for a novice trader to predict is an accurate exit.
if you exit too early, you miss out on valuable profits and further decrease your profit to loss ratio. Yet, if you exit too late, you also lose valuable profits and decrease your P&L ratio. How do you find that sweet spot, to maximize your profits?
The MACD allows us to use past history to predict the duration of the current trend, and exit when it is most necessary.
-How To Apply The MACD And Gain Its Benefits-
Now that we have gone over exactly what the MACD offers, it is time to learn how to use it.
the MACD consists of 4 components:
The signal line (slow line)
The “MACD” line (fast line)
The baseline
The histogram (a visual, often color coded representation of both lines interacting)
These four components interact with each other in a very dynamic way, and allows for very versatile, wave-like movement (one of the only of its kind.) This is incredibly useful, as the market itself works in a very similar wave-like pattern of thrusts and rest, thrusts and rest and so on. there aren’t many other indicators (if any) that display the markets ebb and flow quite like the MACD. Let's break down what each aspect does.
-The Signal Line-
The signal line or ‘slow line’ is calculated based on the 26-period ema. This is the standard numerical value for the MACD, but can typically be adjusted in it’s settings to your preference. The signal line is the basis for whether a trend is overbought/ oversold and whether the momentum is bullish/ bearish.
-The MACD Line (fast line)-
The MACD line is calculated based on the 12-period ema. When the MACD line crosses above the signal line, this is considered the very beginning of a bullish movement. Why is this the case? Well, if the average price of the past 12 candles is moving higher than the average price of the past 26 candles, we can assume that in the short term, the momentum is bullish.
The opposite is also true. when the MACD line is below the signal line, this is the very beginning of a bearish movement.
-The Baseline-
The baseline is considered the very center of the MACD indicator. It is the line where the red and green bars of the histogram meet and where the scale on the right hand side reads zero. The purpose of the baseline is to further indicate the distance between the signal and MACD line.
the higher above the baseline the MACD and signal line go, the further the distance is between the two (meaning the 12-period ema is much higher than the 26-period ema.) This is useful in showing how overbought or oversold the equity is in that particular time frame.
The opposite is also true. the lower below the baseline these lines move, the further apart they are. However, in this case, the 12-ema is much lower than the 26-period ema. This indicates that the price may be oversold.
-The Histogram-
The histogram is the bread and butter of this entire indicator. As you become more familiar, the signal and MACD line will be very helpful in seeing the nuances of a movement and the market as a whole. As a beginner though, the histogram is your best friend. it takes all of the information mentioned previously, and compacts neatly into a color coded, numerical value system.
Each bar of the histogram corresponds to the above candle. This is useful as it allows us to predict future histogram bars, and where the MACD may be headed in the future.
Whenever the MACD line crosses above the signal, the histogram turns green. whenever the MACD line crosses below the signal, the histogram turns red. As the MACD approaches the signal line, the histogram weakens, and the bars grow smaller and smaller - closer and closer to the baseline. However, as the MACD line separates from the signal, the histogram bars grow larger and larger, further from the baseline.
-The Culmination-
All of this information can be combined, to assess the MACD on multiple time frames and make an educated decision on market direction.
A trading plan using the MACD could look something like this (using SPY):
-Before the market opens, check hourly MACD. wait until the hourly looks oversold, and the histogram appears to have peaked. (once the newest histogram bar is shorter than the previous, this marks the peak)
-Once peaked, this indicates that momentum for the next several hours should return to the baseline (spy is oversold)
-Now, you could go to lower time frames such as the 5 and 15 minute, keeping in mind that the hourly is oversold, so buying pressure should be at its heaviest now.
-Use the MACD on the lower time frames to judge the smaller thrust and rest periods, buy at the rests and sell at the thrusts.
Don't even get me started on how I view a chart as a collection of emotions, and how I believe the MACD displays these emotions better than any other indicator can (we'll save that for a separate post.) The MACD and its strategies/ nuances could be talked about for hours, but I hope this helped. I'll likely be doing another post, outlining more concrete examples of how to use it, so stay tuned!
Determination of Divergence Strategy with HHTD Indicator.After the divergence detection, a trend is drawn from the two lows or two highs on the HHTD indicator. The trade is entered after the trend break. The target point can be determined by the Fibonacci levels. Sapma tespitinden sonra, HHTD göstergesindeki iki en düşük veya iki en yüksek değerden bir trend çizilir. Trend kırılmasından sonra ticarete girilir. Hedef nokta, Fibonacci seviyeleri ile belirlenebilir.
DIVERGENCE FOR NOOBSMost people don't understand divergence
Watch this and u will
ENJOY
GRI 2022
For BULLISH divergence look at the LOWs
A higher low on price or the indi is BULLISH
For BEARISH divergence look at the HIGHs
A lower high on the price or indi is BEARISH
If in a bulltrend the indi makes a lower low that's more bullish
If in a beartrend the indi makes a higher high that's more bearish
Testing My Forex Trading Strategy My technique that i used to determine whether to buy or sell a currency pair at any given time.
that technique is based on three Fondamental Points :
CCI (convergence /divergence)
Tops / Bottoms
Trendline
Fibo retracement.
For thiis pair , we expacet an strong bearish to dwon level for next weeks approx (3-4 months)
So Lets see the result by testing this time with EUR NZD
For more information how to learn this method ,you can inbox me at any time
How to send Divergence signals to your Discord server- Do you have a Discord server set up for your own trading community?
- Do you use divergences as part of your trading strategy?
- Would you like to send automated notifications to your Discord server whenever a divergence appears on any chart?
If you have answered yes to all 3 questions above, please keep on reading.
The easiest way to receive automated Divergence alerts to your Discord server, is to combine the alert messages from "The Divergent" divergence indicator on TradingView with a Webhook endpoint on your Discord server.
Step 1: Open Discord, and go to Server Settings
Step 2: Go to Integrations and create a new Webhook
Step 3 (optional): Rename your Webhook to "The Divergent (Divergence indicator)"
Step 4: Select the channel you wish to receive the divergence signals to (i.e. #divergence-signals)
Step 5: Save your Webhook
Step 6: Copy your Webhook URL to your clipboard and head over to TradingView
Step 7: Apply "The Divergent" or "The Divergent (Pro)" indicator to your chart and configure it as you prefer (The free version of The Divergent can signal Regular Divergences only, while the Pro version can signal both Regular and Hidden Divergences)
Step 8: Create a new alert, select "The Divergent" from the top drop down and select one of the Divergence signals (i.e. Regular Bullish)
Step 9: Use the Webhook URL from your clipboard as the Webhook URL of the alert
Step 10: Use the following alert message:
{"content": "The Divergent detected a Regular Bearish Divergence (RSI) on {{exchange}}:{{ticker}} ({{interval}}) @TradingView #divergence $BTC "}
Sample message delivered on Discord:
"The Divergent detected a Regular Bearish Divergence (RSI) on BINANCE:BTCUSDT (60) @TradingView #divergence $BTC"
Feel free to change the content to match your chart / type of divergence you are signalling in the alert.
Note : It is important that you format your alert message as a JSON string, and that you key the message with "content". If you have never used JSON before, it is a good idea to validate your message via jsonlint.com to make sure it is a valid JSON string.
Repeat the same steps for other charts / divergences. Create as many alerts, as many markets / divergences you want to signal to your Discord server.
If you have any questions, please feel free to post it in the comments section below.
If this tutorial was helpful to you, please consider giving it a thumbs up!
Thank you!
Weekly Line Chart DivergencesHello traders,
I am not a financial advisor. I am not telling you to trade any asset. I am simply sharing my ideas on how to use tools to implement my own investment strategy.
Here is a zoomed-out look you can use to come up with some of your own ideas on where the $SPX may go and how to manage your risk. Most of my core strategies are developed on the indices so I will have to implement them on individual tickers unless the comments are interesting.
This is a lagging indicator and should put me on the side of the trade that is *probably* likely to continue. By probably, I mean you need to do your own research and look at what the markets want to go and develop your own tools to work with the data.
Orientation:
Line Chart of ticker on weekly time frame
RSI using 12 periods (or weeks, in this case)
Signals can be marked using a vertical line or time-based axis marker . In this case, I am using 3 colors of lines, explained by the "Monday Action" legend. We will dive into more detail later on.
I also have EMA using ohlc4 on periods (or weeks) 10, 25, 50, 100, 200.
Now to the good stuff:
Divergences have been around for quite some time. Research about the RSI (Relative Strength Index) and it's roots
It is much easier to see something that is larger, than smaller, thus we look at weekly time frames
One can use volume, closing price and RSI to help manage one's risk
Narrowing a decision to 3 choices can help alleviate indecision
So for this application of the RSI and divergence, one can use a simple line chart on a weekly time frame (this chart is based on the closing price from what I can tell, but I was unable to confirm that with the Help Center. I was able to confirm by checking yesterday's close with current reading - it will be different after this post as the weekly close will come in today (writing before market close Friday morning)).
We can start at the March 2020 rally. We can see the March 23rd, 2020 weekly close paint a divergence
on the RSI. One can see the price close at a higher high when compared to March, 16th, 2020. The RSI values remain relatively flat: 17.95 to 18.04.
Find entry
One might conclude this is a time to buy. Because of the magnitude of the move DOWN, the move up was also shorted. One would have to employ the use of other tools in order to find entry in the following week. (Use the white anchored notes to see the explanations of thought process).
Find an entry in the next week. One can place orders on the weekend in "shotgun fashion" perhaps placing 50% order above current price and 50% below, or whatever method suits you.
Hedge Risk
The next yellow line is 08/24 - 31/2020.
The close indicates indecision in the market. Since this is the first divergence I would simply hedge the FANTASTIC long during the March 2020 buy. This can help to be determined from YELLOW vs RED using the 10 period moving-average of volume.
Use options or other means to protect one's long investments
Sell of Heavy Hedge
The next divergence is JAN 2021. This is the second one so I would probably sell at this point.
I would use my other tools to figure out what to do. Heavy hedging can be using derivatives or shorting your long positions.
Timing
A simple way to use this strategy might be to use the color's GREEN, YELLOW, RED, just like traffic lights. There will be deviations, and variations to the method, but if you back-test this you will probably find this works generally well.
Monday Action
Now I used the words Monday Action simply because that was the next possible day to make a decision. I can make my decision probably anytime within Friday if I feel comfortable with it. I can also place actions for Monday on the weekend.
Bottom Line
This week's close is very important. If we follow the green, yellow, red method from above, this very well can be a RED. It can also be another YELLOW. Volume is indicating something big, but we will see!
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!
A lesson in Daily Negative DivergenceFor context of how powerful negative divergence can be (or positive divergence for that matter)
here we have BTC at its first top this year. To my amazement it recovered, as I thought it would
just never get back up again. This is in the daily time frame. Indexes are exhibiting a similar
technical condition but in the weekly time frame.
How To Spot Divergence Without IndicatorsHey y'all… The highly requested—Is here.
Most of us love the idea of a bare chart… but can't seem to let go of the values—by indicators.
One of the most important signals in—Nasdaq100 are divergence.
Pfft… So, I thought… Why not make it easy?
This is my own theory—So… you might not get it on YouTube or books.
I figured this out with experience. Use it wisely; Thank me later.
Cheers,
Lazyluchi
How to catch the TOP : BitcoinRSI Divergence (Bearish): When the price goes high but the RSI goes lower
RSI Divergence (Bullish): When the price goes lower but the RSI goes higher
These can indicate a shift in momentum in the underlying market.
Using the RSI divergence is a great tool to help you find when the price is getting ready for a correction. Keep an eye on bearish RSI divergences on the Bitcoin chart to help you find when a correction will talk place. Conversely, an RSI bullish divergence will indicate potential buying positions.
We are using the Daily time frame to search for RSI divergence on Bitcoin for a major shift in momentum. These can be found on all time frames, the larger time frames the more dramatic the move will potentially be.
Trading View also has an indicator that will find these divergences automatically for your for assistance. "Divergence Indicator" in the built-in indicators.
Volume-Weighted Divergence Play on AAPL 10R via NEXT RSINEXT RSI Divergence Play: Key Concepts
- NEXT RSI is a low-lag, volume-weighted momentum oscillator that often precedes price action
- Divergence play resets at each open (do not count prior session's highs and lows)
- Use as you would other divergence strategies: higher price highs, lower NEXT RSI highs = bearish; lower price lows, higher NEXT RSI lows = bullish
-Use a preset TP / SL and/or close if NEXT RSI retraces back to last relevant high or low
Target Market:
- AAPL 10R Chart
- can be used with almost any market; volatility helps
Order Management:
- Enter on forming divergence, 2 or more clearly separated peaks or troughs
- TP / SL at 30 cents (AAPL)
- Exit if price retraces to the last NEXT RSI top or bottom referenced when opening the position
Optional:
- Additional NEXT RSI strategies can be discovered using the free companion NEXT Strategy Visualizer
VVV destroyer StrategieOANDA:GBPUSD
We got here a clear signal from the VVV strategy
The Rules played OUT as well
We got a confirmation from the VPSV area
Entering the red momentum
Destroyer Cross to the inside
Down the zero line we can follow up the chart
Higher price same volume thats also a WEAK divergence on the chart
Count the confirmations
Example of Shorting SPY w PSI and comparison w RSIThis is an example of Shorting SPY at the High and a comparison of RSI and Price Strength Index (PSI).
AMEX:SPY made a great upside move towards 450 and then 453 on a valid strong move after a bounce of higher Low.
Then, it made a pullback to 450 and made a retest of 453 to go higher.
Price action w PSI analysis
On 4H chart, at the second test of 453, buyer is significantly weaker because it did not even break or test previous High of the PSI 4H. PSI 4H had already shown obvious divergence even before the retest of 453, and when it retest 453 and failed, this give confidence to Short.
Now on Daily, at the second test to 453, PSI shows that the move is not even strong at all. It actually made a lower High on PSI, now confirms the divergence shown on lower time frame 4h. This gives another confidence boost to Short.
With these confluence, this gives a good confidence to Short.
Price action w RSI analysis
On 4H chart, the RSI 4H appears to look good for a push to break that 453 and go into overbought level. Even at the retest of 453, while price action shows that rejection (Red Topping Tail candle), RSI however still looks somewhat okay because it still holding on above 60 and near to previous Low.
On the Daily, RSI is showing that it is still in the direction of the trend to push higher.
To conclude, this is not looking clear, there is a difference of information on 4H and Daily. While RSI on 4H does indeed shows some weakness, RSI on Daily still going strong on uptrend. This does not gives confidence to Short.
PSI vs RSI
While both are useful, PSI do appear to have better clarity of strength/momentum in comparison to RSI.
DISCLAIMER: Nothing in this content should be interpreted as financial advice or a recommendation to buy or sell any sort of security, investment, currencies or assets. This is for educational purposes only.
Here is Why RSI Divergence Will Increase Your ProfitsRSI can be beneficial in your trading if you use it correctly. This printable cheat sheet will assist you in divergence, so you can trade more precisely and increase your profits.
To print this cheat sheet, Right-click the illustration below and then click Save as Picture.
What Is RSI Divergence? With RSI divergence, the relative strength index of a specific asset shows lower highs when the price uptrend hits higher highs. Conversely, when the price is trending downward, it will hit lower lows with divergence while the RSI hits higher lows.
In a bullish divergence scenario you will see RSI show what is called being OVERSOLD and you will see price action form a lower low while the indicator shows a higher low. This represents a transition of volume from seller to buyers and the last push lower is sellers LAST attempt to take control.
The opposite is true for a bearish divergence scenario. You will see price action form a higher high, the last attempt from buyers, while RSI shows a lower high. This is a classic OVERBOUGHT setup and can be very profitable when combined with the rest of your technical analysis.
Those setups give us reversal signal in trending markets as well as ranging markets.
Keep in mind using one strategy is not enough to have consistent profits. Use combinations of strategies and setups to increase your winning rate. Always trade with affordable risk.
What indicator do you use for Divergence? Let us know in the comments
Have a best profits
Artem Shevelev
Chaikin Oscillator From ScratchHi, traders!
Today we'll speak about one of the most pretty instrument of divergence detection.
The Chaikin oscillator is named for its creator Marc Chaikin.1
The oscillator measures the accumulation-distribution line of moving average convergence-divergence (MACD). To calculate the Chaikin oscillator, subtract a 10-day exponential moving average (EMA) of the accumulation-distribution line from a 3-day EMA of the accumulation-distribution line. This measures momentum predicted by oscillations around the accumulation-distribution line.
The purpose of the Chaikin oscillator is to identify underlying momentum during fluctuations in accumulation-distribution. Specifically, it applies the MACD indicator to accumulation-distribution rather than closing prices.
For example, a trader wants to determine whether a coin price is more likely to go up or to fall and MACD is trending higher. The Chaikin oscillator generates a bullish divergence when it crosses above a baseline. The baseline is called the accumulation-distribution line. A cross above that line indicates that traders are accumulating, which is typically bullish.
The Chaikin oscillator utilizes two primary buy and sell signals. First, a positive divergence is confirmed with a center-line crossover above the accumulation-distribution line, signaling a potential buying opportunity. Second, a negative divergence is confirmed with a center-line crossover below the accumulation-distribution line, signaling a potential selling opportunity.
A positive divergence signals a coin price is likely to rise, given the increase in accumulation. A negative divergence signals a coin price is likely to fall, given the increase in distribution.
DISCLAMER: Information is provided only for educational purposes. Do your own study before taking any actions or decisions at the real market.
📉 Your Ultimate Guide to RSI Divergence (Settings & Tips) 📈
Hey traders,
Relative strength index is a classic technical indicator .
It is frequently applied to spot a market reversal.
RSI divergence is considered to be a quite reliable signal of a coming trend violation and change .
Though newbie traders think that the application of the divergence is quite complicated, in practice, you can easily identify it with the following tip s:
💠First of all, let's start with the settings .
For the input , we will take 7/close .
For the levels , we will take 80/20 .
Then about the preconditions :
1️⃣ Firstly, the market must trade in a trend (bullish or bearish)
with a sequence of lower lows / lower highs (bearish trend) or higher highs / higher lows (bullish trend).
2️⃣ Secondly, RSI must reach the overbought/oversold condition (80/20 levels) with one of the higher highs/higher lows.
3️⃣ Thirdly, with a consequent market higher high / lower low, RSI must show the lower high / higher low instead.
➡️ Once all these conditions are met, you spotted RSI Divergence .
A strong counter-trend movement will be expected.
Also, I should say something about a time frame selection .
Personally, I prefer to apply it on a daily time frame , however, I know that scalpers apply divergence on intraday time frames as well.
❗️Remember, that it is preferable to trade the divergence in a combination with some price action pattern or some other reversal signal.
❤️Please, support this idea with a like and comment!❤️