Thursday, May 8, 2014

Diverging Divergences


What is a divergence?
In technical analysis, a divergence occurs when two values that normally move in the same direction fail to do so.  An example is when prices are making higher highs and the Relative Strength Index (RSI) makes a lower high.  Other indicators can be used with similar results. When these divergences occur, the prices usually change direction and follow the indicator.  As such, a divergence is usually a good predictor of imminent price action.
The MetaStock formula team frequently receives requests for formula to identify divergences.  However, this is a visual pattern and a formula must base all signals on mathematical conditions.  Therefore, to create a MetaStock formula for a divergence, we must first precisely define what a divergence is.
Referring to the original definition I first presented, a divergence has two parts:
Price is making a higher high
indicator is making a lower high
A divergence then requires two comparisons.  A "high" in the prices is greater than a previous "high" and a "high" of the chosen indicator is less than a previous "high".  The highs referred to are not of a specific bar but peaks in normal up and down movement of the chart.  Now we have the dilemma, what is a peak?  On this definition rests the entirety of the formula.  Consider the chart below:


Points 1 and 2 show places where the prices reached a top.  However, are these points one peak or two separate peaks with a low between them?  If they are one peak, which line points to the peak?  The answer to that questions is personal opinion and will be different for different traders.  For example, when a 5 % Zig Zag of the close is used, the peaks and troughs are marked this way:


If a 1% zig zag is used instead, the peaks and troughs change to this:


If the chart is focused just on the March / April region, we can observe a second issue.  The chart below added a 1% zig zag of the High (the blue line).


While the peak on 7 March 2014 is the same with both lines, the other peaks are not.  While this is just the difference of a few bars, it can affect if a divergence is found.
Once the peaks of the prices are chosen, the peaks of the indicator must be identified.  This can be done two ways:
apply a calculation to the indicator similar to the one used on the prices
take the value of the indicator at the time of the prices peak/trough
The chart below has added a 14-period RSI with a 1% zig zag.


Notice how much more volatile the RSI zig zag is than the prices.  If we were to just look back at the two most recent price peaks and indicator peaks, the points on the chart would not be aligned.  In this case, a zig zag of the indicator is not the best choice.
An alternative is to look at the value of the indicator at the time of the price peaks.  Consider the chart below:


The peaks of the zig zag of the close are marked with red lines.  the peaks of the zig zag of the highs are marked with blue lines.  I have drawn short trend lines showing the change in the RSI value between the price peaks.
Both of the sets of peaks show an increase in price from one peak to the next. If we were using the Highs, a formula would say there was a divergence.  However the Close actually co-insides with the peaks in the indicator but does not see a divergence as the RSI is also increasing.  Which is more accurate?
Perhaps a better solution would be to revisit the zigzag on the RSI.  Instead of using the RSI itself, let's smooth it first with a 5 period simple moving average:


Now when a 1% zig zag is applied to the moving average, it corresponds very closely to the zig zag of the highs.  When the peaks are compared to the peaks of the highs, both are increasing so no divergence is found:



Would this be a good way to look for divergences?  That is a matter of opinion.  I like the zig zag of the highs because it finds the visual tops of the prices.  By smoothing indicator I could make a zig zag work on the value of the indicator peaks.  I prefer that to take the value of the indicator at the time of the price peak.  Indicator peaks are seldom at the same time as the price peaks and a divergence is suppose to compare tops of indicators to the tops of the prices.
Here is a formula based on above:
plot:= H;
Ind:= Mov( RSI(14), 5, S);
zp:= 1;
sig:= Peak(1, Ind, zp) < Peak(2, Ind, zp) AND
Peak(1, plot, zp) > Peak(2, plot, zp);
Sig=1 AND Ref(sig=0, -1)
The plot to use for the prices, the indicator to search for divergences against, and the zig zag percentage are all assigned to variables.  You can change those as desired.  Through experimentation, you may find a better set of values for identifying divergences.

15 comments:

Urrav K. M. said...

Its an amazing concept you have derived. I tried with Close also and worked just fine. This is Higher Highs and Lower Highs Divergence .... will definitely check for Lower Lows also... I would need your help in increasing the time line. Like Long Term Divergences?? Can You Please Help??

Geometry Dash said...

This is a fantastic explanation of divergences and their complexities! I appreciate the detailed breakdown and formula. Smoothing the indicator with a moving average is a clever approach.

sakura school simulator said...

I love how your writing makes everything feel clear and possible. You have this way of talking about things that makes readers think, “I can do this, I understand this!” This article is another example of your ability to break down ideas into something that feels approachable and empowering. You bring such a friendly tone to your work, and it’s a joy to read. Thank you for always delivering more than just words!

Mirabella Chester said...

Writing about technical analysis requires a deep understanding of market trends and indicators. It’s important to reference credible sources to support your analysis. A great place to buy a research paper that can help on the topic is from reputable academic platforms, which provide in-depth studies and expert insights to enhance the quality and accuracy of your work.

Amanda Parsons said...

This article provides a clear and insightful exploration of divergence indicators in financial analysis, helping readers understand how technical signals can shape investment decisions. It’s a smart read for anyone interested in market trends and data interpretation. Similarly, when academic research becomes complex, many students search for services that can write my dissertation for me UK to receive structured, expert support tailored to their needs.

Phill Jones said...

Ent Clinic in Dubai provides specialized care for ENT emergencies in children, offering prompt and effective treatment for urgent ear, nose, and throat conditions. Equipped with modern facilities and experienced specialists, the clinic ensures safe and accurate management for young patients. Focused on timely intervention and comfort, Ent Clinic handles pediatric ENT emergencies efficiently.

Strands said...

Immaculate Grid is a modern word-and-knowledge puzzle that blends trivia, pattern recognition, and lateral thinking. It challenges players to place items—typically names, places, or concepts—into a structured grid based on overlapping clues and relationships rather than straightforward definitions. Though the concept has taken different forms in apps, print puzzles, and pub quizzes, its core appeal lies in the mix of deduction, general knowledge, and the satisfying “aha” moment when a pattern snaps into place.

Alexis Sanchez said...

HappyHorse AI is a smart tool designed to simplify everyday digital work with advanced automation and intelligent features. This tool helps users complete tasks quickly while improving overall efficiency and accuracy. With its modern AI capabilities, HappyHorse AI delivers a reliable and easy-to-use experience for all kinds of users.

Isla Jane said...

UDISE Plus is an education data system that centralizes important school information for better governance and planning. It records details about enrollment, staff, and infrastructure to support informed policy decisions. Overall, UDISE Plus plays a key role in strengthening and streamlining the education monitoring process. Visit now https://udiseplus.com.co/.

Victoria adam said...

SASSA Status Check helps South African citizens track their social grant application status quickly and easily online. With SASSA Status Check, users can verify payment dates, application progress, and approval details without visiting an office. The service provides a simple and convenient way to stay updated on SASSA grant information anytime.

yuzhang said...

The explanation of divergences in price action is insightful, emphasizing the need for mathematical clarity in trading signals. Understanding the relationship between price highs and indicator highs is crucial for accurate predictions. For those looking to enhance their trading strategies and explore more advanced tools, check out openhuman for innovative solutions tailored to your needs!

Willie joe said...

Roof king Bristol is a trusted local roofing company providing reliable roof repairs, installations, and maintenance services across Bristol. With experienced roofers, quality workmanship, and attention to detail, Roof king Bristol delivers durable roofing solutions for residential and commercial properties.

Daniel Brown said...

As a student, juggling multiple assignments while trying to understand complex theories of governance, international relations, and political ideologies can be truly overwhelming. That's where professional political science assignment writing help becomes a game-changer. From constitutional frameworks to comparative politics, having expert guidance ensures your work is well-researched, properly structured, and academically sound. Whether you are a beginner or an advanced learner, personalised support helps you deliver high-quality assignments confidently. Don't let deadlines stress you out — seek expert assistance today and take your academic performance to the next level!

Alexa said...

platforms like MPTAAS provide structured and useful guidance that helps students and users understand important educational processes, scholarship updates, and digital services in a clear and simple MPTAAS Login Process way. Both blogging platforms and educational portals play a key role in spreading knowledge and improving online learning and awareness.

Odis@6880 said...

K666 Game Apk is a feature-rich mobile gaming app that offers Pakistani users a mix of fun and reward-based experiences. It brings together prediction challenges, casino-inspired games, and sports gaming options within a single platform. Designed for convenience and excitement, the app provides an engaging way to enjoy entertainment while exploring earning opportunities.