What is the code to identify current time frame in MT4?

 

Such as If (Timeframe==Period_H1) then....

For some reason I can't search the documentation for MT4 anymore. Wish they would fix it.

 

I just use google to search mql4.com. Under the google search bar you can click "Advanced Search" and enter your search terms at the top, and put mql4.com in the "Search within a site or domain" field at the bottom.

Here are the timeframe constants.

The function, Period() is probably what you're looking for.

if( Period() == PERIOD_M5 )
{
   Print( "This is a 5 minute chart!" );
}
 
Chad Howarth:

I just use google to search mql4.com. Under the google search bar you can click "Advanced Search" and enter your search terms at the top, and put mql4.com in the "Search within a site or domain" field at the bottom.

Here are the timeframe constants.

The function, Period() is probably what you're looking for.

Thanks