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")?
- Hide an object when the scale of a chart changes
- how to check new bar when EA running on offline chart?
- Indicators with alerts/signal
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 Jomax: 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.
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.

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register