How to change the charts by MQL5?

 
By the following  command  we can change the current chart to a specific chart. But it does not work or does not work properly when it is holiday (for example in Sunday or Saturday) or when the chart is offline. Is there another way to change charts (except "Ctrl+Tab")?
ChartSetInteger(chart id, CHART_BRING_TO_TOP, true )
 

Question unclear. Change the chart to a different symbol or change the chart positioning?

ChartSetInteger(0, CHART_SHIFT, true);


If you want the chart to navigate to the newest tick:

ChartNavigate(0, CHART_END);
 
Jo JomaxBut it does not work or does not work properly when it is holiday (for example in Sunday or Saturday) or when the chart is offline.

If you are using it inside the OnTick() event handler in your EA, or OnCalculate() in your Indicator, then obviously it will not be called when there are no incoming ticks (e.g. weekend).

So, you have to use in one of the other even handlers, like OnTimer() or OnChartEvent(), but it depends on the situation and what you are trying to achieve.