Download MACDik MT4 Indicator

macdik-0Forex traders rely on price movements, therefore the relation between the recent prices and previous movements become important if we want to predict the next move.

MACDik is a modified and optimized version of the original MACD indicator. This modified version gives you a clear picture. When the pair is in an uptrend, MACDik indicator moves above the zero line (price is moving up and away from its moving average). When the pair is in a downtrend, MACDik indicator moves under the zero line (price is moving down and away from its moving average).

How to Trade With MACDik:

Buy Signal:

-Wait for MACDik bar and line cross above the zero level.

Sell Signal:

-Wait for MACDik bar and line cross below the zero level.

 

 

 

 

[php]

//+——————————————————————+
//| macdik.mq4 |
//| Copyright (C) 2010 Vikon |
//| |
//+——————————————————————+
#property copyright “macdik”

#property indicator_separate_window
#property indicator_buffers 2
#property indicator_color1 Yellow
#property indicator_color2 Red
//—- input parameters
//—- buffers
double b[],s[];
string d;
//+——————————————————————+
//| Custom indicator initialization function |
//+——————————————————————+
int init()
{
//—- indicators

SetIndexBuffer(0,b);
SetIndexStyle(0,DRAW_HISTOGRAM,0,4);

SetIndexBuffer(1,s);
SetIndexStyle(1,DRAW_LINE ,0,1);

 

//—-
return(0);
}
//+——————————————————————+
//| Custom indicator deinitialization function |
//+——————————————————————+
int deinit()
{
//—-
ObjectDelete(“ADX”);
//—-
return(0);
}
//+——————————————————————+
//| Custom indicator iteration function |
//+——————————————————————+
int start()
{
int i=Bars;
double b0,b1,b2,i1,i2,s0,s1,s2;
while(i>=0)
{
i1=i+1;
i2=i+2;

b0=iMACD(NULL,0,12,26,9,PRICE_CLOSE,MODE_MAIN,i);
b1=iMACD(NULL,0,12,26,9,PRICE_CLOSE,MODE_MAIN,i1);
b2=iMACD(NULL,0,12,26,9,PRICE_CLOSE,MODE_MAIN,i2);
s0=iMACD(NULL,0,12,26,9,PRICE_CLOSE,MODE_SIGNAL,i);

s[i]=(b0-s0)*10000;

b[i]=((b1-b2)-(b1-b0))*10000;
//(((b1-s1)-(b2-s2))-((b1-s1)-(b0-s0)))*10000;
i–;
}

 

 

return(0);
}
//+——————————————————————+

 

[/php]

 

 Click Here to Download

0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply

Your email address will not be published. Required fields are marked *