Download MetaTrader 5
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. The command is added to chart messages queue and will be executed after processing of all previous commands.

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 the command has been added to chart queue, otherwise false. To get an information about the error, call the GetLastError() function.

Note

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

See also

ChartSymbol, ChartPeriod


Updated: 2015.12.03