Bar count down with MTF indictaors

 

MTF = multi time frame indicators

double BarCountDownInSec()
{
double g;
g=Time[0]+Period()*60-TimeCurrent();
return(g);
}

The above function gives the second count down for bars in the current chart. So if placed on a 5 min chart, it will show second count down for each 5 min bar.

Q: How do I get seconds count down for a 15 minute bar (ie 3x 5 min bars), when I am in a 5 min chart, so a count down of 15 minutes from 6.00 to 6.15. then 6. 15 to 6.30, while I am in a 5 min chart ???

 

double BarCountDownInSec(int timeframe) // timeframe is the one you want to use ie 5,15,30 etc.
{
double g;
g=iTime(NULL,timeframe,0)+timeframe*60-TimeCurrent();
return(g);
}

ihaaaa, I beat phy to it :D