Multi Timeframe Indicators - page 738

 
rkhan1:
Hi M

I downloaded your MTF Moving Average with Shift but it didn,t load

do you have correct one

Also new True Macd

Thanks

rkhan1

Which one exactly?

 
rkhan1:
Hi M

I downloaded your MTF Moving Average with Shift but it didn,t load

do you have correct one

Also new True Macd

Thanks

rkhan1

Which one exactly?

 

Hi M

This is the one from page 359

https://www.mql5.com/en/forum/173574

also do have true Macd or something close or better

Thx

Files:
 
rkhan1:
Hi M

This is the one from page 359

https://www.mql5.com/en/forum/173574

also do have true Macd or something close or better

Thx

rkhan1

This is the updated version : mtf_ma_with_shift_nmc.mq4

 

Got it

any macd updated

Thx

 
rkhan1:
Got it

any macd updated

Thx

Maybe this one here: https://www.mql5.com/en/forum/178018/page64 or maybe one in that thread.

 

Mr T

Mr M

I think there are some differences between Macd

I will test these ones

Thx Again

 
rkhan1:
Mr T

Mr M

I think there are some differences between Macd

I will test these ones

Thx Again

The real macd has ema for signal

The one that metatrader made uses sma for signal

According to Gerald Appel (the inventor of macd) signal line must be ema (that is cleared a long time ago that metatrader is the only trading platform that does not have a correct macd). That indicatyor from that posts allows you to set the signal line as yu wish so you can have it the correct way (ema) or incorrect way (sma).

 

Hi M

Your right

This is the Macd I have been using , I am comparing to yours

This is the code, does it look right to you

//+------------------------------------------------------------------+

//| MACD with crossing.mq4 |

//| Copyright © 2004, MetaQuotes Software Corp. |

//| MetaTrader 5 Trading Platform / MetaQuotes Software Corp. |

//+------------------------------------------------------------------+

#property copyright ""

#property link ""

//---- indicator settings

#property indicator_separate_window

#property indicator_buffers 3

#property indicator_color1 Gold

#property indicator_color2 Red

#property indicator_color3 Gray

#property indicator_width1 2

//---- indicator parameters

extern int FastEMA=12;

extern int SlowEMA=26;

extern int SignalSMA=9;

//---- indicator buffers

double MacdBuffer[];

double SignalBuffer[];

double HistogramBuffer[];

//---- globals

int maxLines;

//+------------------------------------------------------------------+

//| Custom indicator initialization function |

//+------------------------------------------------------------------+

int init()

{

SetIndexStyle(0,DRAW_LINE);

SetIndexStyle(1,DRAW_LINE);

SetIndexStyle(2,DRAW_HISTOGRAM);

//

SetIndexBuffer(0,MacdBuffer);

SetIndexBuffer(1,SignalBuffer);

SetIndexBuffer(2,HistogramBuffer);

//

SetIndexLabel(0,"MACD");

SetIndexLabel(1,"Signal");

SetIndexLabel(2,"MACD-Signal");

//

SetIndexDrawBegin(1,SignalSMA);

IndicatorDigits(Digits+1);

IndicatorShortName("MACD("+FastEMA+","+SlowEMA+","+SignalSMA+")");

return(0);

}

//+------------------------------------------------------------------+

//| |

//+------------------------------------------------------------------+

int deinit()

{

DeleteLines();

return(0);

}

//+------------------------------------------------------------------+

//| Moving Averages Convergence/Divergence |

//+------------------------------------------------------------------+

int start()

{

double crossing;

int limit,i;

int counted_bars=IndicatorCounted();

//----

if(counted_bars>0) counted_bars--;

limit=Bars-counted_bars;

//----

for(i=0; i<limit; i++) MacdBuffer=iMA(NULL,0,FastEMA,0,MODE_EMA,PRICE_CLOSE,i)-iMA(NULL,0,SlowEMA,0,MODE_EMA,PRICE_CLOSE,i);

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

{

SignalBuffer=iMAOnArray(MacdBuffer,Bars,SignalSMA,0,MODE_SMA,i);

HistogramBuffer=MacdBuffer - SignalBuffer;

}

//----

DeleteLines();

for(i=WindowBarsPerChart(); i>0 ;i--)

{

crossing=(MacdBuffer-SignalBuffer)*(MacdBuffer-SignalBuffer);

if (crossing < 0)

{

maxLines+=1;

ObjectCreate("MacdCross"+maxLines,0,0,Time,0);

ObjectSet("MacdCross"+maxLines,OBJPROP_COLOR,DimGray);

ObjectSet("MacdCross"+maxLines,OBJPROP_STYLE,STYLE_DOT);

}

}

return(0);

}

//+------------------------------------------------------------------+

//| |

//+------------------------------------------------------------------+

void DeleteLines()

{

for(int i=1;i<=maxLines;i++) ObjectDelete("MacdCross"+i); maxLines=0;

}

//+------------------------------------------------------------------+

can you tell me how to add MTF to this one just for knowledge

Thx

Files:
 
rkhan1:
Hi M

Your right

This is the Macd I have been using , I am comparing to yours

This is the code, does it look right to you

//+------------------------------------------------------------------+

//| MACD with crossing.mq4 |

//| Copyright © 2004, MetaQuotes Software Corp. |

//| MetaTrader 5 Trading Platform / MetaQuotes Software Corp. |

//+------------------------------------------------------------------+

#property copyright ""

#property link ""

//---- indicator settings

#property indicator_separate_window

#property indicator_buffers 3

#property indicator_color1 Gold

#property indicator_color2 Red

#property indicator_color3 Gray

#property indicator_width1 2

//---- indicator parameters

extern int FastEMA=12;

extern int SlowEMA=26;

extern int SignalSMA=9;

//---- indicator buffers

double MacdBuffer[];

double SignalBuffer[];

double HistogramBuffer[];

//---- globals

int maxLines;

//+------------------------------------------------------------------+

//| Custom indicator initialization function |

//+------------------------------------------------------------------+

int init()

{

SetIndexStyle(0,DRAW_LINE);

SetIndexStyle(1,DRAW_LINE);

SetIndexStyle(2,DRAW_HISTOGRAM);

//

SetIndexBuffer(0,MacdBuffer);

SetIndexBuffer(1,SignalBuffer);

SetIndexBuffer(2,HistogramBuffer);

//

SetIndexLabel(0,"MACD");

SetIndexLabel(1,"Signal");

SetIndexLabel(2,"MACD-Signal");

//

SetIndexDrawBegin(1,SignalSMA);

IndicatorDigits(Digits+1);

IndicatorShortName("MACD("+FastEMA+","+SlowEMA+","+SignalSMA+")");

return(0);

}

//+------------------------------------------------------------------+

//| |

//+------------------------------------------------------------------+

int deinit()

{

DeleteLines();

return(0);

}

//+------------------------------------------------------------------+

//| Moving Averages Convergence/Divergence |

//+------------------------------------------------------------------+

int start()

{

double crossing;

int limit,i;

int counted_bars=IndicatorCounted();

//----

if(counted_bars>0) counted_bars--;

limit=Bars-counted_bars;

//----

for(i=0; i<limit; i++) MacdBuffer=iMA(NULL,0,FastEMA,0,MODE_EMA,PRICE_CLOSE,i)-iMA(NULL,0,SlowEMA,0,MODE_EMA,PRICE_CLOSE,i);

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

{

SignalBuffer=iMAOnArray(MacdBuffer,Bars,SignalSMA,0,MODE_SMA,i);

HistogramBuffer=MacdBuffer - SignalBuffer;

}

//----

DeleteLines();

for(i=WindowBarsPerChart(); i>0 ;i--)

{

crossing=(MacdBuffer-SignalBuffer)*(MacdBuffer-SignalBuffer);

if (crossing < 0)

{

maxLines+=1;

ObjectCreate("MacdCross"+maxLines,0,0,Time,0);

ObjectSet("MacdCross"+maxLines,OBJPROP_COLOR,DimGray);

ObjectSet("MacdCross"+maxLines,OBJPROP_STYLE,STYLE_DOT);

}

}

return(0);

}

//+------------------------------------------------------------------+

//| |

//+------------------------------------------------------------------+

void DeleteLines()

{

for(int i=1;i<=maxLines;i++) ObjectDelete("MacdCross"+i); maxLines=0;

}

//+------------------------------------------------------------------+

can you tell me how to add MTF to this one just for knowledge

Thx

That one is using SMA for signal line - it is the same as the built in metatrader one

Reason: