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

To add comments, please log in or register
ericjschroeder
22
ericjschroeder  

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

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

Chad Howarth
80
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.

if( Period() == PERIOD_M5 )
{
   Print( "This is a 5 minute chart!" );
}
David Muriithi
197
David Muriithi  
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

To add comments, please log in or register