ChartOpen

Opens a new chart with the specified symbol and period.

long  ChartOpen(
   string           symbol,     // Symbol name
   ENUM_TIMEFRAMES  period      // Period
   );

Parameters

symbol

[in]  Chart symbol. NULL means the symbol of the  current chart (the Expert Advisor is attached to).

period

[in]  Chart period (timeframe). Can be one of the ENUM_TIMEFRAMES values. 0 means the current chart period.

Return Value

If successful, it returns the opened chart ID. Otherwise returns 0.

Note

The maximum possible number of simultaneously open charts in the terminal can't exceed the CHARTS_MAX value.