CChart.Next() probblem

 

In my mt5 there are two opened chart with a timeframe (1H) and a superiortimeframe (4Hour)
It seems the method Next of calls CChart doesn't work.
It remain always on the same chart.
Here the code

#include <Charts\Chart.mqh>
......
CChart indexChart;
......
indexChart.FirstChart();

int limit=30;
    while(h<=limit) {
                  if(indexChart.Symbol() == Symbol() && indexChart.Period() ==timeframeSup )                          
                                       {
                                        Print("Found TF sup",timeframeSup);
                                        break;                                 
                                        }

                   else {

                            indexChart.Next(); 

                            Print("next ",indexChart.Symbol()," ",indexChart.Period());

                          }                                                       
                   h++;
             }
 

Forum on trading, automated trading systems and testing trading strategies


Hello,

Please use the SRC button when you post code. Thank you.


This time, I edited it for you.


The right method is NextChart(), not Next().

Reason: