number of open charts

 

Hi every body

I want to have the number of all current open charts in mt5.

can you help me plz? 

 
mahdiz:

Hi every body

I want to have the number of all current open charts in mt5.

can you help me plz? 

Hello mahdiz, please try this approach

//---
int OpenedCharts()
  {
   long prevChart=ChartFirst();
   int chartCount = 0;
   while(prevChart!=-1)
     {
      prevChart=ChartNext(prevChart);
      chartCount++;
     }
   Print("Number of charts = ", chartCount);
   return chartCount;
  }

Dont forget to tell us the result!

I hope it helps you somehow!

Malacarne 

 
Malacarne:

Hello mahdiz, please try this approach

Dont forget to tell us the result!

I hope it helps you somehow!

Malacarne 

it works just grate.

thanks a lot. 

Reason: