MACD indicator - page 28

 

thank you very much for your quickly reply !

i'm sorry that i did not make the thing clear !

i like the color because the osma could change color when its current value larger or smaller than it's previous value !

so, i hope the All TF MACD can also change color when the value change !

thanks again !

for(i=0; i<limit; i++)

ind_buffer3=iOsMA(NULL,0,FastEMA,SlowEMA,SignalSMA,AppliedPrice,i)*3;

//---- dispatch values between 2 buffers

bool up=true;

for(i=limit-1; i>=0; i--)

{

current=ind_buffer3;

prev=ind_buffer3;

if (((current0))||(current<0)) up= false;

if (((current>0)&&(prev0)) up= true;

if(!up)

{

if(current > prev)

{

ind_buffer2s=current;

ind_buffer2=0.0;

ind_buffer1=0.0;

ind_buffer1s=0.0;

}

else

{

ind_buffer2=current;

ind_buffer2s=0.0;

ind_buffer1=0.0;

ind_buffer1s=0.0;

}

}

else

{

if(current < prev)

{

ind_buffer1s=current;

ind_buffer1=0.0;

ind_buffer2=0.0;

ind_buffer2s=0.0;

}

else

{

ind_buffer1=current;

ind_buffer1s=0.0;

ind_buffer2=0.0;

ind_buffer2s=0.0;

}

}

Sadly:
Open both indicators in MetaEditor and look at each #property indicator_color. It's here that you can alter the colours to match.
 
 

thank you so much ! though it is a little different with what i need, but I can modify it by myself now !

thanks again !

newdigital:
Try this indicator https://www.mql5.com/en/forum/173574/page149
 

still need help

hi guys, I still need your help !

I made some change on mladen's all macd, and it can change color now

but i meet some problems.

please see the pic below:

the first indicator is macd_osma_4color, and the second is all macd with only H1 TF, and the last is all macd with H1 and H4 TF !

you could see that, the first indicator and the second show the same color and value !

but the third is different ! so, could anybody help me to solve this problem ?

i really do not know what the problem is !

thank you very much !

and I attach the indicator !

Files:
7.jpg  144 kb
 

...

If you want same values you should turn the equalize parameter off

equalize parameter is there for cases when you have more time frames and you want to see MACD without something like the 3rd macd on the picture (MACD is an oscillator, but it does not have known minimum and maximum and since it measures differences between two moving averages higher time frames tend to give much higher values that the lower time frames)

_________________________

Also, since you started the coding part (but please, do not misunderstand this, I think you will enjoy much more when you finish the coding you have started ), just one tip without final solution : in the part of the code where you compare values in order to determine colors, the loop goes from left to right (line 300) so you can not compare the current (already "equalized" value) with the previous (non-"equalized" value)

The reason for different colors lays in this part of code. When you finish coding, you will have it as it should be

(this code - you have to change something in it )

for(i=0; i<barsPerTimeFrame;i++,k++)

{

ExtMapBuffer5[k] = ExtMapBuffer7[k]*koef;

ExtMapBuffer6[k] = ExtMapBuffer6[k]*koef;

// osma[k] = OSMA[k]*koef;

// current = osma[k];

// prev = osma[k+1];

current = ExtMapBuffer5[k]-ExtMapBuffer6[k];

prev = ExtMapBuffer5[k+1]-ExtMapBuffer6[k+1];

if (((current0))||(current<0)) up= false;

if (((current>0)&&(prev0)) up= true;

....

regards

mladen

yevell:
hi guys, I still need your help !

I made some change on mladen's all macd, and it can change color now

but i meet some problems.

please see the pic below:

the first indicator is macd_osma_4color, and the second is all macd with only H1 TF, and the last is all macd with H1 and H4 TF !

you could see that, the first indicator and the second show the same color and value !

but the third is different ! so, could anybody help me to solve this problem ?

i really do not know what the problem is !

thank you very much !

and I attach the indicator !
Files:
macd.gif  25 kb
 

thanks for you help, mladen !

i have try my best but i still could not get the right thing !

so, could you kindly post the final solution ?

thanks again !

best wishes !

mladen:
If you want same values you should turn the equalize parameter off

equalize parameter is there for cases when you have more time frames and you want to see MACD without something like the 3rd macd on the picture (MACD is an oscillator, but it does not have known minimum and maximum and since it measures differences between two moving averages higher time frames tend to give much higher values that the lower time frames)

_________________________

Also, since you started the coding part (but please, do not misunderstand this, I think you will enjoy much more when you finish the coding you have started ), just one tip without final solution : in the part of the code where you compare values in order to determine colors, the loop goes from left to right (line 300) so you can not compare the current (already "equalized" value) with the previous (non-"equalized" value)

The reason for different colors lays in this part of code. When you finish coding, you will have it as it should be

(this code - you have to change something in it )

for(i=0; i<barsPerTimeFrame;i++,k++)

{

ExtMapBuffer5[k] = ExtMapBuffer7[k]*koef;

ExtMapBuffer6[k] = ExtMapBuffer6[k]*koef;

// osma[k] = OSMA[k]*koef;

// current = osma[k];

// prev = osma[k+1];

current = ExtMapBuffer5[k]-ExtMapBuffer6[k];

prev = ExtMapBuffer5[k+1]-ExtMapBuffer6[k+1];

if (((current0))||(current<0)) up= false;

if (((current>0)&&(prev0)) up= true;

....

regards

mladen
 

Lazy :):)

Replace that code with this one :

for(i=0; i<barsPerTimeFrame;i++,k++)

{

current = ExtMapBuffer7[k]-ExtMapBuffer6[k];

prev = ExtMapBuffer7[k+1]-ExtMapBuffer6[k+1];

if (((current0))||(current<0)) up= false;

if (((current>0)&&(prev0)) up= true;

//

//

//

ExtMapBuffer5[k] = ExtMapBuffer7[k]*koef;

ExtMapBuffer6[k] = ExtMapBuffer6[k]*koef;

It is what is called "it has everything, but at wrong place". Only the steps were in a wrong order, nothing else Btw: those are, when you are writing the code, hardest to spot. When someone else looks at it, it is likely that he/she will spot it immediately . Once I lost 3-4 days just to find out that I need to invert 2 line position

regards

mladen

yevell:
thanks for you help, mladen !

i have try my best but i still could not get the right thing !

so, could you kindly post the final solution ?

thanks again !

best wishes !
Files:
macd_1.gif  23 kb
 
mladen:
Lazy :):)

Replace that code with this one :

for(i=0; i<barsPerTimeFrame;i++,k++)

{

current = ExtMapBuffer7[k]-ExtMapBuffer6[k];

prev = ExtMapBuffer7[k+1]-ExtMapBuffer6[k+1];

if (((current0))||(current<0)) up= false;

if (((current>0)&&(prev0)) up= true;

//

//

//

ExtMapBuffer5[k] = ExtMapBuffer7[k]*koef;

ExtMapBuffer6[k] = ExtMapBuffer6[k]*koef;

It is what is called "it has everything, but at wrong place". Only the steps were in a wrong order, nothing else

Btw: those are, when you are writing the code, hardest to spot. When someone else looks at it, it is likely that he/she will spot it immediately . Once I lost 3-4 days just to find out that I need to invert 2 line position

regards

mladen

THANK YOU!

You are great!

 

Macd

MACD, which stands for Moving Average Convergence Divergence, is a trend-following momentum indicator that shows the relationship between two moving averages of prices. Developed by Gerald Appel, MACD is one of the simplest and most reliable indicators available. This tool is used to identify moving average which indicate a new trend, regardless of whether it is bullish or bearish. After all, the most important priority in trading is to find a trend, because the most money revolves around it.

The most popular formula for the "standard" MACD is the difference between 26-day and 12-day Exponential Moving Averages (EMAs). This is the formula that is used in many popular technical analysis programs and quoted in most technical analysis books. Using shorter moving averages will produce a quicker, more responsive indicator, while using longer moving averages will produce a slower indicator, less prone to whipsaws.

MACD

 

how to get the value diff from MACD ? or what is the Diff ? thank !

Reason: