Download MetaTrader 5

I want to get the High price for the next higher timeframe

To add comments, please log in or register
Ash
5
Ash  

I have this code &  i am trying to get the High for the next higher timeframe. If it is M1 then M15 ; if M15 then M30 etc. 

 

however this is not working. please help 

int timeFrame[] = {1,5,15,30,60,240,360,1440,10080,43200},nextTF;

int init()
{
for(int i=0;i<ArraySize(timeFrame);i++){
if(i==ArraySize(timeFrame)-1){nextTF=timeFrame[i];Print("Sorry maximum time frame reached");break;}
if(timeFrame[i]==Period()){nextTF=timeFrame[i+1];break;Print("i "+i);}
}
}
if( Period() == PERIOD_M5 )
{
  iHigh(NULL,t,1);
}

      whroeder1
      15015
      whroeder1  
      Where do you set the variable t?
      To add comments, please log in or register