MTF : How to get a "normal" iHigh(NULL,PERIOD_M15,i)

 

Hey guys, this issue makes me crazy, and I didnt find (or understand) any solution.

My iCustom indicator (working on 1M chart) is using differents times frame, such as :

M15HighPrice[i]=iHigh(NULL,PERIOD_M15,i);
M5HighPrice[i]=iHigh(NULL,PERIOD_M5,i);

But why a new value is calculted every minute, instead of every 15 minutes (for PERIOD_M15), or every 5 minutes (for PERIOD_M5)  ?  The software seems to recalculate every minute the high price of the last 15 minutes.

Is it possible to fix it ? 

Thanks guys. 

 
Because it's on M1.
 
Federico Sistri:
Because it's on M1.

Thanks federico. So there is no way to "call" a M15 value on an indicator working on a M1 chart ? 

 

You are already doing it, but it's being calculated on every bar.

Only solution is to move it to a higher tf (M5, M15, etc.).

 
Or you can find a function that calculates it every N bars, thus skipping the bars you don't want.
 
Sam_ax:

But why a new value is calculted every minute, instead of every 15 minutes (for PERIOD_M15), or every 5 minutes (for PERIOD_M5)  ?  The software seems to recalculate every minute the high price of the last 15 minutes.

if you are looking at the current m15 bar, the the value of the high may change until it has closed.

 
Federico Sistri:
Or you can find a function that calculates it every N bars, thus skipping the bars you don't want.

That was what I was afraid of. Anyway, I was looking for a more elegant solution, I can stop now. I imagine that with MT5, it will be the same. Thank you anyways !