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

Back to topics list To post a new topic, please log in or register
avatar
1
apatil1991 2016.02.23 03:01
 

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);
}

      avatar
      13000
      WHRoeder 2016.02.23 13:27 #
       
      Where do you set the variable t?
      Back to topics list  

      To add comments, please log in or register