Services , new functionality in the MT5 architech, the funeral of MT4 is just around the corner. - page 6

 
Petros Shatakhtsyan:


Yes, but you also have to consider that there's only one timer, not so VC++, and if you have a lot of timing checks, you just might lose a lot of ticks, and everything will turn to mush.

It's not a problem. Just in one timer you do one check each time the timer starts and the others X seconds after the last relevant check.
 
Alexey Kozitsyn:
It's not a problem. It's just that in one timer you do one check every timer run, and the others X seconds after the last relevant check.


I don't get it. Do you know how much it costs to run a timer. Is it possible to run it more than 1 time.

I said that every tick is important and you are talking about seconds. They should all work in parallel, independently of each other.

 
Petros Shatakhtsyan:


I don't. Do you know how much it costs to run the timer. Is it possible to run it more than 1 time.

I said that every tick is important and you are talking about seconds.

Running the timer costs exactly as much as is needed for the task if it can't be done otherwise. It doesn't need to be run many times, just do one check 3 times out of 3 runs and another 1 time out of 3. I hope the idea is clear now.

 
Petros Shatakhtsyan:


It would be inefficient if EA handles every tick, even if milliseconds are used in timer.

Need an easier way to get all the ticks directly from the market overview.

A through OpTisk is not possible, because it only works when the next tick comes where the EA is standing.


The variant is to run it on the most volatile symbol. Of course, there will be some loss... but there will be a loss in speed of logic execution for the entire EA
 
Maxim Dmitrievsky:

Well, as an option run on the most volatile symbol. of course there will be some loss... but there will also be a loss in speed of execution of all EA's logic


That's why I told you to make another OnTick that will receive ticks from all symbols that are currently available in the market overview. A simple and fast variant.

And not only that. You should also have a function that returns the real leverage that each symbol has.

 
Petros Shatakhtsyan:


And so said to make another OnTick, which got the ticks from all the symbols currently available in the market overview. A simple and quick option.

Actually, OnTick() skips ticks. Even OnCalculate() skips ticks. Also, ticks can come in packs. So, the timer is not something very expensive, all the more so when analyzing many characters. The main thing is to make the calculation cost-effective.
 
Alexey Kozitsyn:
Actually, OnTick() skips ticks. Even OnCalculate() skips ticks. In addition, ticks may come in packs. So, the timer is not something very expensive, all the more so when analyzing many characters. The main thing is to make an economical calculation.

Well, you can do it through a timer as well. The good thing is that we have EventSetMillisecondTimer but it is bad that it also starts OnTimer. We should have added OnMillisecondTimer.
 
Petros Shatakhtsyan:

Well, you can do it with a timer. It's good that EventSetMillisecondTimer exists, but it's bad that it also starts OnTimer. You should have added OnMillisecondTimer.

What's stopping you from doing it this way?

void OnTimer()
{
if( condition1 )
   {...копируем тики...}
if( condition2 )
   {...иной расчет, который не нужно запускать так часто, как condition1...}
}
And on the whole, it would be good if we add the symbol field as the OnBookEvent() handler.
 
Alexey Kozitsyn:
Actually, OnTick() skips ticks. Even OnCalculate() skips ticks. In addition, ticks may come in packs. So, the timer is not something very expensive, all the more so when analyzing many characters. The main thing is to make an economical calculation.

The timer will also skip ticks, if you need to count them right up to the tick, you need to count them by the tick volume there... but it won't save you either... ticks may come very quickly and in batches, yes
 
Maxim Dmitrievsky:

timer will also miss, if you need to go straight to the tick you need to keep track of them, by the tick volume there... but it won't save either... ticks can come very quickly and a lot, yes
Nothing can save that. You can't process absolutely every tick.
Reason: