Multi Timeframe Indicators - page 423

avibe
54
avibe  
mrtools:
Hi Chrisstoff, You were close, here's a fixed version.You will probably see it in the code better than me explaining, my explaining is not to good sometimes.

thank you for this

Chrisstoff
524
Chrisstoff  

Here goes the version that I originally wanted to make.

All merit goes to Mladen and MrTools

ps) new mt4 compatible version posted here https://www.mql5.com/en/forum/173574

affandiz
6
affandiz  
mladen:
I think that mrtools is resting on this weekend so here is this version

thanks a lot...

affandiz
6
affandiz  
mladen:
I think that mrtools is resting on this weekend so here is this version

hi mladen it is posible to make the indi show more arrow like in second picture?

i try to create mtf indicator using icustom like attached but its make my laptop hang.

thanks in advance

mtf_sfractals_alert.mq4

Files:
Bob Fisher
316
Bob Fisher  

Multipair Multitimeframe

MLaden, MrTools and anyone else?

I have a multi pair multi timeframe custom indicator that I wrote. I store my pairs in a pair array and the time frames in a session arrlay. What I want to do is to initially calculate the first dozen bars, 0 to 12, of a iCustom call to a special MACD I wrote and then to determine the MACD zero crossovers and the MACD Signal crossovers during this time. Thereafter, I only need to make the iCustom calls for the uncounted bars.

So, I calculate the counted_bars and limit in the standard manner and then do a MathMin on limit and 12. Next 3 loops are setup, one for the pair, one for the time frame and one for the bars to be calculated.

What I am finding is that the initial limit of 12 gets called 4 times for one pair (not always the same pair and not the chart pair) then the chart pair gets called once for the same bar and then calculations reset and the time frame limit changes from 12 to 2. After this, the print diagnostics generally show the pairs ascend by their index. However, there are many cases where there is an index gap or an index reset or even sometimes just one line of the diagnostics.

Can anyone explain what is happening? Is this problem being caused by incoming ticks to either the chart window or the two iCustom calls. What happens when an indicator is in the middle of calculations and another tick arrives? I thought the indicator finished and this tick ignored when the next one came in.

The other possibility I considered was there was a buffer overflow on the Experts tab due to the relative slowness of printed output. However, from examining the index that this is highly unlikely.

Finally, is it possible to call the calculation function once from the init() function and eliminate the need for the special case in the start() function.

Here is the relevant code

If anyone has any suggestions, I'd like to know, either on this thread of through a private message. Your ideas and suggestions will be appreciated as I have spent considerable time trying to identify and fix this problem.

void Calculate_MAsAndMACDs(int index, int session, int bar,int limit, int counted_bars)

{

string pair;

pair=Symbols.Pair;

int previous=bar+1;

macd= iCustom(pair,Session.Period[session],File.MACD, 3,4,3,8,13,false,1,bar);

signal=iCustom(pair,Session.Period[session],File.MACD, 3,4,3,8,13,false,0,bar);

Print(Symbols," Counted Bars-b ",index," ",bar," ",Bars," ",IndicatorCounted()," ",limit," ",counted_bars);

MACD.Trend=1;

if(macd<signal) MACD.Trend=-1;

if(macd > signal && macd[previous] < signal[previous]) {MACD.CrossOverTime=Time; MACD.CrossOverTimeValue=1;}

if(macd signal[previous]) {MACD.CrossOverTime=Time; MACD.CrossOverTimeValue=-1;}

if(MACD.CrossOverTime == 0) MACD.CrossOverTime=Time[ActiveCrossOverBars+1];

if(macd >0. && macd[previous] <0.) {MACD.CrossedTime=Time; MACD.CrossedTimeValue=1; }// Print("crossed up ",bar," ",MACD.CrossedTimeValue);}

if(macd 0.) {MACD.CrossedTime=Time; MACD.CrossedTimeValue=-1;}// Print("crossed dn ",bar," ",MACD.CrossedTimeValue);}

//if(Symbols == "XAUUSD")

Print(Symbols," Counted Bars-b ",index," ",bar," ",Bars," ",IndicatorCounted()," ",limit," ",counted_bars," ",DoubleToStr(macd,7)," ",DoubleToStr(macd[previous],7)," ",TimeToStr(MACD.CrossedTime,TIME_MINUTES)," ",TimeToStr(Time,TIME_MINUTES)," ",MACD.CrossedTimeValue);

if(MACD.CrossedTime == 0) MACD.CrossedTime=Time[ActiveCrossOverBars+1];

if(macd >= macd[previous]) MACD.Slope=1; else MACD.Slope=-1;

MACD.Signal.Trend=1;

if(signal<signal[previous]) MACD.Signal.Trend=-1;

}

int start()

{

int Y.Height,session,index,xpos,counted_bars=IndicatorCounted(), elements=ActiveCrossOverBars+2;

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

if(counted_bars>0) counted_bars--;

int limit = MathMin(Bars-counted_bars,Bars-1);

limit = MathMin(limit,elements);

for(int i=0;i<Session.Order.Number;i++)

{

session=Session.Order;

for(index=0;index<Symbols.Number;index++)

{

Print(Symbols," Counted Bars-a ",index," ",-1," ",Bars," ",IndicatorCounted()," ",counted_bars," ",limit);

ArrayResize(macd,elements); ArrayResize(signal,elements);

for(int k=limit;k>=0;k--) Calculate_MAsAndMACDs(index, session, k, limit, counted_bars);

}

}

return(0);

Files:
diagnostics.jpg 216 kb
hyrulxxx
29
hyrulxxx  

hi , i need your help to make this indicator in MTF version ...

thanks alot for your help

Files:
ut_fast.mq4 26 kb
dansmol
211
dansmol  

Dear mladen and mrtools

Will you be so kind to add MTF option to the

two indicators attached?

Thank you very much for your time

Dan

macerina
161
macerina  

Is there an option to set custom time frame

schwager:
Thanks gordon!

Excelent Indikator!!

now MTF version

Much fun

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

Pls. can someone provide an option to set custom time frame in the #MTF_4_CoeffoLine

Does this paint??

Thanks in advance

Exciter135
29
Exciter135  

Help MTF indi.

Dear buddies,

Please help me make these indicators in MTF. I sincerely thank you and highly appreciate for your help.

Best regards,

Exciter135.

Files:
xx3xxx
1754
xx3xxx  

I always got doubt about MTF -- can our emotion handle loss for such a long period of time, if our bet go sour ==== the concept of getting to see what MTF look like and shorter TF, it could repaint wildly with MTF in place