On H1 how to have MACD ( 59 minute H-1) ?

 

Hello

I m beginner  (in English too) and i would like on a H1 Chart, at each new candel, have the MACD value of the last minute of the last hour.

If I use imacd whith a shift=1 its Ok during the first minute but during the rest of the hour its a probleme because if its 13h12 I have the 13h11 MACD and i would like to have the 12h59 macd value.

 

Thanks for your help

stephane 

 

I find !

Shift=Minute()+1

 
iMACD(NULL,PERIOD_M1,FastEma,SlowEma,SignalPeriod,AppPrice,MODE_MAIN,iBarShift(NULL,PERIOD_M1, StrToTime(Hour()+":00"))+1 )
 

Thanks but I have a problem.

When i put my indicator on the chart it wait a new 1H candel to paint Ok and i ts correct but It dont paint the past, It must be used in 'live' only...I would like test my indicator on the past too 

 
datetime chart0  = Time[0],
         prevM1  = chart0 - 60;
int      iPrevM1 = iBarShift(NULL, PERIOD_M1, prevM1);
double   value   = iMACD(NULL, PERIOD_M1, ... iPrevM1);
 

Sorry but i dont hunderstand something...

What is the difference beetween this 2 codes because the result on chart is the same... 

 Thanks

 Edit : Im stupid i dont change  chart0  = Time[0] by  chart0  = Time[i].

It works perfectly.

Thanks 

Reason: