MQL4 - automated forex trading   /  

Code Base

Code Base  Indicators  FX5_MACD_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_MACD_Divergence
Author: FX5 (2007.06.14 11:29)
Rating: 8.8
Downloaded: 20573
Download:
 FX5_MACD_Divergence_V1.1.mq4 (12.4 Kb) View
 FX5_MACD_Divergence_V1.0.mq4 (12.1 Kb) View


After the success of the original indicator, I decided to write more indicators for detecting divergence between price and other indicator.



This indicator will plot divergence lines on the MACD indicator and will give buy and sell signal by displaying green and red arrows. It also has a built-in alert function. As the original indicator, bullish divergence is plotted in green lines while bearish divergence is plotted in red. If the divergence is classic the line will be solid and if the type is reversed the line will be interrupted.



I hope you gets the most benedfit from this indicator.

Changes to verion 1.1:

- This version is directed to traders who do not want repainted singals. The signals are not repainted buy they are delayed one candle.

 

19 comments: 1 2   To post a new comment, please log in or register

Very good indicator. Is there anything on RSI like this.

21.07.2009 10:41 1007

Nice indi, thanks!!


21.04.2009 21:59 cyberpasta
FX5 wrote:
ashishbhatia wrote:
hi...i am using the indicator for sometime now, could you tell me which timeframe its best used on, i check all the timeframes, but find 5 mins comfortable. Also, there are some hidden signals given, which are not the classic MACD divergence, how relaible are those, would apprectiate your reply.
thanks


I prefer using it on higher timeframes. In my openion 4Hr is the best timeframe for this indicator.

Regarding your second question, I heard that some traders trade only hidden divergens so it reliable as the classical divergence.

Good Luck,

Hi FX5

Thanks for your indicator.

Can you write this indicator in Tradestation or Metastock code?

regards,

02.01.2009 11:49 crlin1212
Can I get an EA that will buy and sell using this indicator strategy? dgib1038@yahoo.com
27.10.2008 04:02 dgib1038
Meta1 wrote:

Hi FX5,

good work! I looked an Indikator like these for long time.

If you take DMI (Directional Movement ) the result are very better. This is a concept from Welles Wilder, named "Topsy-turvy-Strategy"

and based of reverse Divergenz

His book: New Concepts in Technical Trading Systems

Can you build an Indicator with DMI and "reverse Divergenc"?

Best regards

Meta1  

 

 

Hi FX5

I think it's a very good indicator thanks a lot ;-)

I would like to write an EA that should enter a buy order when the "green" or sell order when "red" arrows of your indicator appears.

Can you help please ;-)

Thanks in advance

Fabio 

16.10.2008 18:29 Fabio

Hi FX5,

good work! I looked an Indikator like these for long time.

If you take DMI (Directional Movement ) the result are very better. This is a concept from Welles Wilder, named "Topsy-turvy-Strategy"

and based of reverse Divergenz

His book: New Concepts in Technical Trading Systems

Can you build an Indicator with DMI and "reverse Divergenc"?

Best regards

Meta1  

 

 

17.08.2008 16:28 Meta1

Thank you for this indicator.

A little bit oof topic:

I have would like to translate the Ehlers sinewave from Tradestation language to MQL4 ... but I do not know the language well enough.

'Ehlers sinewave indicator translation into MQL4'

Would you be interested in coding this in MQL4?

Thanks !

----------------------------------------------

Inputs: Price((H+L)/2),
alpha(.07);

Vars: Smooth(0),
Cycle(0),
I1(0),
Q1(0),
I2(0),
Q2(0),
Deltaphase(0),
MedianDelta(0),
Maxhmp(0),
AmpFix(0),
Re(0),
Im(0),
DC(0),
alpha1(0),
InstPeriod(0),
DCPeriod(0),
count(0),
Smoothcycle(0),
Realpart(0),
Imagpart(0),
DCPhase(0);

smooth = (Price + 2*Price[1] + 2*Price[2] + Price[3])/6;

Cycle = (1 - .5*alpha)*(1 - .5*alpha)*(Smooth - 2*Smooth[1] + Smooth[2]) + 2*(1 - alpha)*Cycle[1] - (1 - alpha)*(1 - alpha)*Cycle[2];
If currentbar < 7 then Cycle = (Price - 2*Price[1] + Price[2]) / 4;
{Cycle = Price;}

Q1 = (.0962*Cycle + .5769*Cycle[2] - .5769*Cycle[4] - .0962*Cycle[6])*(.5 + .08*InstPeriod[1]);
I1 = Cycle[3];
If Q1 <> 0 and Q1[1] <> O then Deltaphase = (I1/Q1 - I1[1]/Q1[1]) / (1 + I1*I1[1]/(Q1*Q1[1]));

If Deltaphase < 0.1 then Deltaphase = 0.1;
If Deltaphase > 1.1 then Deltaphase = 1.1;
MedianDelta = Median(Deltaphase, 5);
If MedianDelta = 0 then DC = 15 else DC = 6.28318/MedianDelta + .5;
InstPeriod = .33*DC + .67*InstPeriod[1];
Value1 = .15*InstPeriod + .85*Value1[1];

{Compute Dominant Cycle Phase}
DcPeriod = IntPortion(value1);
RealPart = 0:
ImagPart = 0;
For count = 0 To DcPeriod - 1 begin
RealPart = RealPart + Sine(360 * count/DcPeriod) * (Cycle[count]);
ImagPart = ImagPart + Cosine(360 * count/DcPeriod) * (Cycle[count]);
End;
If AbsValue(ImagPart) > 0.001 then DcPhase = Arctangent(RealPart / ImagPart);
If AbsValue(ImagPart) <= 0.001 then DcPhase = 90 * Sign(RealPart);
DcPhase = DcPhase + 90:
If ImagPart < 0 then DcPhase = DcPhase + 180;
If Dcphase > 315 then DcPhase = DcPhase - 360;
Plot1(Sine(DcPhase), "Sine");
Plot1(Sine(Dcphase + 45), "LeadSine");

02.02.2008 15:31 marcb
vladv wrote:
It's a good indicator!

Thanks vladv.
17.08.2007 21:52 FX5
It's a good indicator!
17.08.2007 13:06 vladv
ashishbhatia wrote:
hi...i am using the indicator for sometime now, could you tell me which timeframe its best used on, i check all the timeframes, but find 5 mins comfortable. Also, there are some hidden signals given, which are not the classic MACD divergence, how relaible are those, would apprectiate your reply.
thanks


I prefer using it on higher timeframes. In my openion 4Hr is the best timeframe for this indicator.

Regarding your second question, I heard that some traders trade only hidden divergens so it reliable as the classical divergence.

Good Luck,

15.08.2007 22:41 FX5