Documentation
MQL5 ReferenceChart OperationsChartSetSymbolPeriod 

ChartSetSymbolPeriod

Changes the symbol and period of the specified chart. The function is asynchronous, i.e. it sends the command and does not wait for its execution completion.

bool  ChartSetSymbolPeriod(
   long             chart_id,     // Chart ID
   string           symbol,       // Symbol name
   ENUM_TIMEFRAMES  period        // Period
   );

Parameters

chart_id

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

symbol

[in]  Chart symbol. NULL value means the current chart symbol (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

Returns true if successful, otherwise false.

Note

The symbol/period change leads to the re-initialization of the Expert Advisor, attached to a chart.

See also

ChartSymbol, ChartPeriod