Mt4 End of support. - page 45

 
Alexey Viktorov:

Peter, stop. I don't need any other function to define a new bar other than my own. Well it just so happens that all your labours have become unnecessary, sorry.

It doesn't bother me. I even feel like I'm hurting people here a lot more. So I'm the one who's sorry.
 
Реter Konow:
Why?

Every time a timestamp character is accessed, is it searched for in the arrays?

 
Dmitry Fedoseev:

Is the timestamp character searched for in the arrays each time it is accessed?

Not necessarily. You can cycle through the timeframes to sort those where new bar events have occurred, or you can directly access a timeframe symbol if you know their sequence numbers in the Symbols and Timeframes arrays.
 
Реter Konow:
Not necessary. You can sort those in the loop by timeframes symbols where new bar events occurred, or you can directly access the timeframe symbol if you know their sequence numbers in the Symbols and Timeframes arrays.

What does sorting have to do with it? Prim that in a loop. We're talking about tracking one timeframe symbol from one meta, and another timeframe symbol from another place. One option is to search in an array, the other option is to need additional variables, which will be piled into a common pile of global variables.

 
Dmitry Fedoseev:

What does sorting have to do with it? Prim that in a loop. We're talking about tracking one timeframe symbol from one meta, and another timeframe symbol from another place. One way is to search in an array, the other way is to use additional variables, which will be piled into a heap of global variables.

Alternatively, you could once find the required symbol-timeframe in the array of symbols and timeframes in the loop, and store their indexes in static variables. Next, simply directly access the array New_Bar_Events[][] by values of these variables and track.
 
Реter Konow:
Alternatively: once you have found the required symbol-timeframe in the array of symbols and timeframes in the loop and saved their indexes in variables. Then you just directly access the array New_Bar_Events[][] by values of these variables and monitor.

Looking in an array is too much unnecessary. You could just declare a variable for the past timeframe and check it in place or pass it into a function.

 
Dmitry Fedoseev:

Looking in an array is too much unnecessary. You could just declare a variable for the past time and check it in place or pass it into a function.

Finding it once is not too much unnecessary.

 
Реter Konow:

Find once - not much extra.


A little bit of everything will be a lot.

If to search, these indexes then drag to some place in the code, it is better to drag there one variable for last time and there is no need to search for anything.

 
Dmitry Fedoseev:

If you look for these indexes then drag them to some place in the code, it's better to drag one variable there for the past time and you won't need to look for anything.

By the way, Dimitri, if you trade only on the instruments you need, and not on the whole list in the market review, then there won't be such a problem at all. You will initialize the arrays of symbols and timeframes yourself and you'll know exactly where to check the new bar event in the New_BarEvents[][] array.
 
Реter Konow:
By the way, Dimitri, if you trade only the instruments you need and not the whole list in the market review, there won't be such a problem at all. You initialize the arrays of symbols and timeframes yourself, and you'll know exactly where to check the event of a new bar in the array New_BarEvents[][].

No))) I won't do that at all.

Reason: