MQL4参考 图表操作 ChartPeriod

ChartPeriod

Returns the timeframe period of specified chart.

ENUM_TIMEFRAMES  ChartPeriod(
   long  chart_id=0      // Chart ID
   );

Parameters

chart_id=0

[in]  Chart ID. 0 means the current chart.

Return Value

The function returns one of the ENUM_TIMEFRAMES values. If chart does not exist, it returns 0.