Download MetaTrader 5
To add comments, please log in or register
Carry on your private correspondence in your profile. It is secure!
trader201
404
trader201 2014.08.28 16:18 
Hello. I want to write PERIOD_CURRENT in a timeframe of an indicator. And I want a more big period in other indicator, in a way that make the change automatic, and not manual.

Somebody know what I need to write for do this? (maybe a word that mean something like next timefrime or something like this?)


Thank you in advance

trader201

whroeder1
13607
whroeder1 2014.08.28 18:11  
trader201: something like next timefrime
learn to code it, or pay someone. We're not going to code it FOR you. We are willing to HELP you when you post your attempt (using SRC) and the nature of your problem.
Not compiled, not tested
ENUM_TIMEFRAMES GetHigherTF(ENUM_TIMEFRAMES cur = PERIOD_CURRENT){
   static ENUM_TIMEFRAMES  tfPeriods[]={  PERIOD_M1,  PERIOD_M5, PERIOD_M15, 
                                          PERIOD_M30, PERIOD_H1, PERIOD_H4, 
                                          PERIOD_D1,  PERIOD_W1, PERIOD_MN1   };

   if(cur == PERIOD_CURRENT)  cur = _Period;
   for(int i = 0, tfPeriods[i] != cur; ++cur){}
   return tfPeriod[i+1];
}
Not compiled, not tested
/
To add comments, please log in or register