I have searched the docs, but couldn't find any specific function to count the number of opened charts on MT5 terminal.
To solve this problem I came up with this solution:
string ChartIdList; // To be called as a global variable
for(int i=1;i<100;i++) // To be called on OnInit(), for instance
Print("Number of opened charts = "+CountCharts);
However, I don't know if this is the best approach, once I'm not sure if such a feature already exists as a built-in function...
Does anybody know if this feature actually exists?
ChartFirst() and ChartNext() return a long, why are you using a string array to save these values ?
Print("Number of charts = ", chartCount);
I don't think there is a built-in function for that.