Download MetaTrader 5

Multi Timeframe Indicators - page 5

To add comments, please log in or register
sailor
486
sailor  

looks good but i was wondering why i can not attach YEN pairs only reason why is that i think YEN pair is using ehh my english lol .... compare the quote

euro has 1.2000 and usdjpy 117.50 ( look after decimal )

sailor

Anthony
271
Anthony  
sailor:
looks good but i was wondering why i can not attach YEN pairs only reason why is that i think YEN pair is using ehh my english lol .... compare the quote

euro has 1.2000 and usdjpy 117.50 ( look after decimal )

sailor

I was going to post about that and I forgot. As it is, it doesn't work with some of the pairs because of what you described above. I'm going to have to try to wrap my head around the math to come up with a general multi-purpose formula that will normalize all of them. I think I'll ask Code Guru or Igor for help with that.

I threw that together pretty quickly while on a break at work, so let me work on it tonight and I'll see if I can't get all the bugs worked out.

Also, I updated the indicator so that CorrBarrs defaults to 50 instead of 100. Doesn't really matter what it is, but on the higher timeframes (D1), sometimes the prices seperate so much over say 100 days, that you don't see both MAs on the screen.

sailor
486
sailor  

I remmember i had the same problem with the gridbuilder before i posted it a programmer helped me and it should be sommething with divisor i wraped out som of the code from gridbuilder

double Divisor = 0.1/Point;

HighPrice = MathRound(High * Divisor);

//SL = High;

LowPrice = MathRound(Low[Lowest(NULL,0,MODE_LOW, Bars - 1, 2)] * Divisor);

GridS = GridSpace / 10;

sailor

zhu28ming
58
zhu28ming  

Multi Timeframe Indicators

Hello, Dear Keris:

Would you please help to convert this MACD-2 to Multi timeframe?

Thankd a lot

jingming

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

//| macd-2.mq4 |

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

//| http://www.metaquotes.net/ |

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

#property copyright "Copyright ?2004, MetaQuotes Software Corp."

#property link "http://www.metaquotes.net/"

//---- indicator settings

#property indicator_separate_window

#property indicator_buffers 4

#property indicator_color1 Magenta

#property indicator_color2 Yellow

#property indicator_color3 White

#property indicator_color4 Yellow

//---- indicator parameters

extern int FastEMA=12;

extern int SlowEMA=26;

extern int SignalEMA=8;

//---- indicator buffers

double ind_buffer1[];

double ind_buffer2[];

double ind_buffer3[];

double ind_buffer4[];

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

//| Custom indicator initialization function |

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

int init()

{

//---- 2 additional buffers are used for counting.

IndicatorBuffers(5);

//---- drawing settings

SetIndexStyle(0,DRAW_HISTOGRAM,STYLE_SOLID,2);

SetIndexStyle(1,DRAW_HISTOGRAM,STYLE_SOLID,2);

IndicatorDigits(MarketInfo(Symbol(),MODE_DIGITS)+2);

SetIndexDrawBegin(0,SignalEMA);

SetIndexDrawBegin(1,SignalEMA);

//---- 4 indicator buffers mapping

if(!SetIndexBuffer(0,ind_buffer1) &&

!SetIndexBuffer(1,ind_buffer2) &&

!SetIndexBuffer(2,ind_buffer3) &&

!SetIndexBuffer(3,ind_buffer4))

Print("cannot set indicators\' buffers!");

//---- name for DataWindow and indicator subwindow label

IndicatorShortName("MACD-2");

//---- initialization done

return(0);

}

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

//| Oscillator |

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

int start()

{

int limit;

int counted_bars=IndicatorCounted();

double prev,current;

//---- check for possible errors

if(counted_bars<0) return(-1);

//---- last counted bar will be recounted

if(counted_bars>0) counted_bars--;

limit=Bars-counted_bars;

//---- macd counted in the 1-st additional buffer

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

ind_buffer3=iMA(NULL,0,FastEMA,0,MODE_EMA,PRICE_CLOSE,i)-iMA(NULL,0,SlowEMA,0,MODE_EMA,PRICE_CLOSE,i);

//---- signal line counted in the 2-nd additional buffer

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

ind_buffer4=iMAOnArray(ind_buffer3,Bars,SignalEMA,0,MODE_EMA,i);

//---- dispatch values between 2 buffers

bool up=true;

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

{

current=ind_buffer3-ind_buffer4;

prev=ind_buffer3-ind_buffer4;

if(current>prev) up=true;

if(current<prev) up=false;

if(!up)

{

ind_buffer2=3*current;

ind_buffer1=0.0;

}

else

{

ind_buffer1=3*current;

ind_buffer2=0.0;

}

}

return(0);

}

Anthony
271
Anthony  

Macd-2

zhu28ming,

Here's the MTF version of MACD-2. Remember, you need both the original macd-2.mq4 and the new #MTF_MACD-2.mq4 for it to work.

Keris

Files:
macd-2.mq4 3 kb
zhu28ming
58
zhu28ming  

Macd-2

Thanks so much for the help, Keris. It really solved my big problem.

Jingming.zhu

sailor
486
sailor  

Hey

Kerrie or other do u know if it is posible to have like and cloned moving average pips above/ below existing movingaverage?

sailor

sailor
486
sailor  

ups just forget my last post but if any1 was thinking of the same. use in the indicator property window level add. But kerry do u know why we cant do that on the MTF movingaverage

sailor

Anthony
271
Anthony  
sailor:
ups just forget my last post but if any1 was thinking of the same. use in the indicator property window level add. But kerry do u know why we cant do that on the MTF movingaverage sailor

Custom indicators don't support levels. I've modified #MTF_MovingAverage.mq4 so that you can add levels (simulated). Use the inputs tab. If you want levels, change UseLevels to True. Then, you can set Levels 0-5 to whatever you want.

See pics. Let me know if it works ok for you.

Keris

Files:
levels1.gif 17 kb
levels2.gif 15 kb
RedJack
51
RedJack  
keris2112:
Custom indicators don't support levels. I've modified #MTF_MovingAverage.mq4 so that you can add levels (simulated). Use the inputs tab. If you want levels, change UseLevels to True. Then, you can set Levels 0-5 to whatever you want.

See pics. Let me know if it works ok for you.

Keris

i used your MTF_moving average on my charts it is very very good i downloaded before i dont know if this one is different but your work is just marvelous

Jack

123456789101112...1205
To add comments, please log in or register