Errors, bugs, questions - page 1339

 
A100:
Why?
To see the logic.
 
Karputov Vladimir:
In order to see the logic.
Printed it out - described the result above
 
A100:
Printed it out - the result is described above
Where did you print it out? Where is the result? I don't see it - you forgot to attach the printout before and after.
 
Karputov Vladimir:
Where was the printout? Where is the result? I don't see it - you forgot to attach the printout before and after.

Before the reset Before

After resetting After

 

No Header displayed when adding a picture in the forum

I am filling in the Header field. The picture is displayed but the header is not

 
A100:

Different order of graphs in a profile

If you add a new graph to multiple graphs in a profile and move it to the middle, say

then in the subsequent listing of charts with the script using

it will be moved to the last one in spite of the fact that it is in the middle

And if you reload the MT, it will be in the middle, like in the figure, during the new enumeration

It turns out different behaviour before and after reloading. Where is the logic?

We have added "EURAUD", "EURCAD", "EURUSD" and "NZDUSD" and activated the first chart - "EURAUD"

Step 1

"NZDUSD" is placed after "EURAUD" and we activate the first chart - "EURAUD"

Step 2

After reloading (the first chart remains active - "EURAUD")

Step 3

Everything makes perfect sense. Only before the script is called:

//+------------------------------------------------------------------+
//|                                                    ChartNext.mq5 |
//|                        Copyright 2014, MetaQuotes Software Corp. |
//|                                              http://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2014, MetaQuotes Software Corp."
#property link      "http://www.mql5.com"
#property version   "1.00"
//+------------------------------------------------------------------+
//| Script program start function                                    |
//+------------------------------------------------------------------+
void OnStart()
  {
//--- переменные для идентификаторов графиков
   long currChart,prevChart=ChartFirst();
   int i=0,limit=100;
   Print("ChartFirst = ",ChartSymbol(prevChart)," ID = ",prevChart);
   while(i<limit)// у нас наверняка не больше 100 открытых графиков
     {
      currChart=ChartNext(prevChart); // на основании предыдущего получим новый график
      if(currChart<0) break;          // достигли конца списка графиков
      Print(i,ChartSymbol(currChart)," ID =",currChart);
      prevChart=currChart;// запомним идентификатор текущего графика для ChartNext()
      i++;// не забудем увеличить счетчик
     }
  }
//+------------------------------------------------------------------+

you must choose the active chart carefully. The next graph is counted from the active one.
 
Karputov Vladimir:

Everything makes perfect sense.

What is the logic in that? If there was one sequence 2-3-4-5 before the reboot, and after the reboot there is another 2-5-3-4?
 
A100:
And what is the logic behind this? If before rebooting there was one sequence 2-3-4-5, and after rebooting there was another 2-5-3-4?

Before reloading, the graphs are written to the profile in the order they were created, i.e. 1-2-3-4. Before reloading, the profile is rewritten (the last revision of the graph movements is written to it, i.e. 1-4-2-3-3). After the reboot, the graphs are redrawn (created) according to the last revision of the graph movements, i.e. 1-4-2-3-3.

And so after the reboot, since the charts were created in the order of 1-4-2-3, it means that ChartNext() will return exactly that order.

 
Karputov Vladimir:

Before reloading, the graphs are written to the profile in the order they were created, i.e. 1-2-3-4. Before reloading, the profile is rewritten (the last revision of the graph movements is written to it, i.e. 1-4-2-3-3). After reloading, the graphs are redrawn (created) according to the last revision of the graph movements, i.e. 1-4-2-3-3.

The question is not how it is currently implemented (it can be implemented differently), but that before and after reloading (all other things being equal) the result is different, and therefore the logic is broken.
 
A100:
The question is not how it is currently implemented (it could be implemented differently), but that before and after reloading (all other things being equal) the result is different, which means that the logic is broken.
I believe that the logic is not violated because after the terminal is reloaded the charts are recreated and therefore ChartNext() works correctly. But you can make a request to servicedesk - please share the answer afterwards.
Reason: