Download MetaTrader 5

CChart.Next() probblem

To add comments, please log in or register
You sell neither signals nor apps? No problem, everyone can make profit!
gioooooo
47
gioooooo 2015.06.25 15:18 

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++;
             }
Alain Verleyen
Moderator
30727
Alain Verleyen 2015.06.25 18:07  

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().

To add comments, please log in or register