Download MetaTrader 5

number of open charts

To add comments, please log in or register
mahdiz
18
mahdiz  

Hi every body

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

can you help me plz? 

Rodrigo Malacarne
Moderator
10253
Rodrigo Malacarne  
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 

mahdiz
18
mahdiz  
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. 

To add comments, please log in or register