ChartClose - all charts?
yeders: I imagine you could do a loop, close chart Id = 1, id +1, until ID = 100 (no more then 100 charts?)
Don't hard code numbers, don't assume. Read the documentation
for(int i=0;i<20;i++)
long chid=ChartFirst(); while(chid >= 0){ // Just do ALL charts, no counting needed. long nextID = ChartNext(chid); // Get the next chart before closing current if(ChartSymbol(chid)==cs)ChartClose(chid); chid = nextID; // process next chart. }
Hi,
I'm wondering the easiest way to close all charts. I need it as I have a script that opens about 50 charts to apply a template, and I want an easy way to close them all.
I have utilised this script ( https://www.mql5.com/en/code/11566 ), but it only closes charts of the same currency pair.
I imagine you could do a loop, close chart Id = 1, id +1, until ID = 100 (no more then 100 charts?)
Any help would be great.
Thanks