Divergence is a powerful tool for detecting price reversal points from support and resistance zones. It usually gives us a relatively early signals compared to those given by moving average indicators. It can be successfully applied to many technical indicators and end up with good results.
This indicator will plot divergence lines between the price and OsMA indicator. It will give buy/sell signal according to the type of divergence that was detected. The indicator also is capable of drawing divergence lines for the whole history prices located within a specific chart.
Bullish divergence will be plotted with green lines on both price and OsMA idicator windows.
Bearish divergence will be plotted with red lines on both price and OsMA idicator windows.
I hope this indicator prove to be a useful tool.
Changes to Version 1.5:
Changes to version 2.0:
Thank you very much for these excellent divergence indicators. Could you make one that draws regular an hidden divergences for Schaff Trend Cycle?
08.11.2013 00:32 grayghost
How to detect that arrow?
I want to use for ea
and, is there anyone have version 3 at mq4 format?
13.05.2012 23:14 raden.batman
we need divers only if line up above price and line down lower price
and needs bar’s color depend of previous bar – if previous bar of indi bigger, lower or equal
I can suggest some cosmetic code changes. I think, this may make code a little more readable.
1. In deinit()
if(StringSubstr(label, 0, 14) != "DivergenceLine") continue; ObjectDelete(label);
if(StringSubstr(label, 0, 14) == "DivergenceLine") ObjectDelete(label);
2. In IsIndicatorPeak()
if(OsMA[i] > OsMA[shift]) break;
if(OsMA[i] > OsMA[shift]) return(false);
(and so in IsIndicatorTrough()).
14.08.2008 12:57 Sajan
Nice and very good Indicator. can you make the same idea for Indicators Stochastic Momentum and Rsi ?
it will be very powerful maybe in one window?
thank for this one
Can you make the arrow appear in real time? not like the last bar behind it.
28.05.2008 12:03 Togu
I have questions. I’ve installed the latest fx5 divergence indicators one that repaints and one that doesn’t but I happen to miss the signal all the time. Does the arrow appear after one bar has already closed?
i wanted to SELL on one signal but it appears it only showed just after openning another bar I’ve been monitoring last couple of hours and now I see the arrow. It seems like I’m very late at least one bar or two. Does any1 misses the arrow? Because I’ve been thinking to sell on a signal right after the arrow bar closes.
28.05.2008 12:02 Togu
Could you possibly help by putting the Sendmail function into the indicator for when there is a signal? I tried but my coding ability is less than optimal !! Great indicator….using it to make nice $$$ in futures markets!!!! Maybe a quick explanation of how/when this indicator works? Thanks for sharing your work!!
26.03.2008 19:59 forexman05
is there a chance you could create a code that gives the arrow on the close of the divergence candle. I find when using this with other indicators it creates some great opportunities