Get the Timeframe of the current chart by robot

 

How do I query the current timeframe of the chart by robot?

In the older versions of Metatrader I have got the correct timeframe by Period() for example:

1 = M1, 2 = M5, 3=M15, 4=M30...

Now the Period() return value is  0(zero) - allways. It is useless.

Thanks,

Norbert

 

everything works

т

int OnInit()
  {
   Alert("Period=",Period());
   return(INIT_SUCCEEDED);
  }
void OnDeinit(const int reason)
  {
  }
void OnTick()
  {
  }

This website uses cookies. Learn more about our Cookies Policy.