MQL4 - automated forex trading   /  

Code Base

Code Base  Indicators  FX5_Divergence To post a new code, please log in or register

This library is for
MetaTrader 4
Download MT 4 - 5.5 Mb

Mobile trading!
Buy a license and be mobile in your trading!

Name:
FX5_Divergence
Author: FX5 (2007.06.05 13:54)
Rating: 7.6
Downloaded: 12436
Download:
 FX5_Divergence_V2.0.mq4 (12.2 Kb) View
 FX5_Divergence_v1.5.mq4 (14.6 Kb) View
 FX5_Divergence_v1.1.mq4 (12.6 Kb) View
 FX5_Divergence_V2.1.mq4 (11.3 Kb) View

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:

  • A bug was fixed in updating divergence lines as the live quotes flow;
  • A sound Alert feature was added to the indicator and can be enabled or disabled from indicator settings;
  • Classical divergence is plotted in Solid Style (continues) lines, while hidden divergence is plotted in Dot Style (interuppted) lines.

Changes to version 2.0:

  • The code was rebuilt from scratch to make the indicator runs much faster.
  • The indicator now doesn't repaint any of its signals.
  • Some improvements in the signal identification algorithms.

Version 2.1:

  • I attached the last file by mistake. This is the one I wanted to attach. It is the last version. I am designating it version 2.1.

 

36 comments: 1 2 3 4   To post a new comment, please log in or register
pn12 wrote:
i would like to ask you if the indicator repaints i have wathed the arrow apear and then disapear
also i have watched the indicator and it seems it doesnt update in real time ,
for example when i leave the indicator on the chart sometimes it doeasnt show any divergence
but when i refresh the chart or switch between time frames and came back to the same time frame then the indicator shows divergence lines.
Sorry to bother you with all these questions but i think you have made an amazing indicator ,i am just trying to understand better how it works
i am attaching a pic of what i mean about the arrow apearing and dissapearing where you see the yellow line with the yellow tick is where the arrow apeared with the divergence live and then dissapeared


The indicator doesn't repaint the signals, and once an arrow appear it should remain visible. On the other hand there was a bug in version 1.1 which stopped the indicator from updating in the real time. This bug was fixed in version 1.5.

From the chart you attached I can see that you are using version 1.5 so you should not experience any problems.

There was no signal at the yellow tick on your chart because the green area between the two red areas didn't reach the minimum elevation which is set by the sensitivity parameters. If you set those parameters to 0 you should get a signal in your case.

Good Luck,

14.05.2007 16:15 FX5
i would like to ask you if the indicator repaints i have wathed the arrow apear and then disapear
also i have watched the indicator and it seems it doesnt update in real time ,
for example when i leave the indicator on the chart sometimes it doeasnt show any divergence
but when i refresh the chart or switch between time frames and came back to the same time frame then the indicator shows divergence lines.
Sorry to bother you with all these questions but i think you have made an amazing indicator ,i am just trying to understand better how it works
i am attaching a pic of what i mean about the arrow apearing and dissapearing where you see the yellow line with the yellow tick is where the arrow apeared with the divergence live and then dissapeared
Once more thank you for your great job
07.05.2007 05:11 pn12

07.05.2007 05:08 pn12
pn12 wrote:
thanks for the indicator
you have done a great job
is it possible to add a sound alert when the arrow apears?
thanks again

In the the new version v1.5 you will find the sound alert feature.

Good luck,
06.05.2007 02:09 FX5

05.05.2007 22:18 pn12
waddahattar wrote:
Thank you very much my brother

It is a perfect indicator..

Very usefull indicator ,thank you very much
is it possible to add a sound alert when the arrow appears ?
thanks again for your nice work
04.05.2007 22:16 pn12
gbolla wrote:
Hi, I have a problem with this indicator. When I load on terminal, I can't reopen the platform. I use MT4 203 on Xp SP2. Why? When I open the Task Manager, I see that CPU work at 98% for terminal process but the platform don't appair.. .Why? What can I do? Thanks . Bolla

To identify all divergence opportunities on the chart, the indicator has to do a lot of calculation which may consume much of the system processing resourses. This process will happen only one time after you attach the indicator to the chart or restart MetaTrader. After that the indictor will run very smoothly.

If you have a lot of history prices on your chart or your system processing power is poor and you are not interested in the history divergence information, you could adjust historyBarsCount parameter in the indicator to apply the indicator on the number of the chart bars you choose. For example, if you set this parameter to 500, the indicator will identify divergence only in the last 500 bars. This should reduce the indicator initiation time.

Good luck,
12.04.2007 12:23 FX5
walsz wrote:
Most imressive indicator, though it's keeps crashing my MetaTrader every time I'm trying to use it.( like after 10 -20 min )Did any body have the same problem?

Thank you.


It is quite odd to know that the indicator crashes MetaTrader after 10 - 20 min. In this period of time the indicator should have been executed more than 100 times, and if there was any bug that could cause the system to crash it should show up as soon as you you attach the indicator to the chart.

However, I suggest you check the experts tab in the terminal window for any error messages that could appear during the indicator operation.

Good luck,
12.04.2007 11:52 FX5
Hi, I have a problem with this indicator. When I load on terminal, I can't reopen the platform. I use MT4 203 on Xp SP2. Why? When I open the Task Manager, I see that CPU work at 98% for terminal process but the platform don't appair.. .Why? What can I do? Thanks . Bolla
10.04.2007 18:20 gbolla
Most imressive indicator, though it's keeps crashing my MetaTrader every time I'm trying to use it.( like after 10 -20 min )Did any body have the same problem?

Thank you.
05.04.2007 09:11 walsz