Errors, bugs, questions - page 1562

 

I run the tester through two characters at once in "real ticks" mode. Synchronisation is accurate to the millisecond. Therefore, sometimes there seems to be a mismatch of tick sequences. There can be several ticks in 1ms on two characters at once. Tell me, what is the algorithm for feeding ticks in such situations?

And how, without IndicatorRelease, to optimally manage to catch each tick in the tester (the timer in 1 ms skips ticks), when there is a passage on several symbols at once?

 
Anton Zverev:

I run the tester through two characters at once in "real ticks" mode. Synchronisation is accurate to the millisecond. Therefore, sometimes there seems to be a mismatch of tick sequences. There can be several ticks in 1ms on two characters at once. Tell me, what is the algorithm for feeding ticks in such situations?

And how is it optimal to catch every tick in the tester without IndicatorRelease (the timer misses ticks in 1 ms), when there are several symbols passing at once?

In the tester, the minimum time quantum is 1 second. Therefore it is useless to run the timer at 1ms.

There may be several ticks in one and the same second. And from different tools. The algorithm of ticks feeding is such, that by the moment of tick time for the instrument under test, all ticks of other instruments for the same second are already submitted.

 
Slawa:

In the tester, the minimum time quantum is 1 second. It is therefore useless to start the timer at 1ms.

There can be several ticks in the same second. And from different instruments. The algorithm of ticks feeding is such, that by the moment of tick time for the instrument under test, all ticks of other instruments for the same second are already submitted.

Would you consider the normal solution of calling the EA on every tick in the tester?
 
Anton Zverev:
Would you consider the normal solution of calling the EA on every tick in the tester?
In the tester, the EA is called on every tick of the instrument under test
 
Slawa:
In the tester, the Expert Advisor is called at every tick of the tested symbol

You know exactly what I'm asking. I run two symbols, I can't catch ticks of the second one. People have long suggested the only solution - through IndicatorRelease. But it looks crutchy by itself.

I saw various multisymbol testers. I faced such a problem only in five. How it is that you haven't foreseen it is a mystery.

Please think how to improve MQL so that this weakest link is removed and the product is really complete. I have proposed my own variant but yours is 100% more reasonable.

 
Anton Zverev:

You know exactly what I'm asking. I run two symbols, I can't catch ticks of the second one. People have long suggested the only solution - through IndicatorRelease. But it looks crutchy by itself.

I saw various multisymbol testers. I faced such a problem only in five. How it is that you haven't foreseen it is a mystery.

Please think how to improve MQL so that this weakest link is removed and the product is really complete. I proposed my own variant but yours is 100% more reasonable.

This is another question.

What is "catching the second tick"?

How do you catch the ticks of the second tool when you run the EA normally?

 
Slawa:

That's another question.

What is "catch the ticks of the second"?

For the EA to be called at every tick of the second symbol.

How do you catch the ticks of the second symbol when the EA is normally launched?

I place the indicator through IndicatorRelease on the second symbol. At every tick of its symbol it creates the ChartEvent event. The Expert Advisor, respectively, catches this event.

This poor solution was suggested many years ago, according to the search results. I haven't found another working solution. If the test should be conducted on 10 symbols, then 9 indicators are launched.

Suppose we have an Expert Advisor that increases the counter on every tick.

I am running it on one symbol in the tester, where it is 1 million ticks. The counter shows 1 million.

I also reached another symbol and it shows 1 million.

I put it through two symbols at once. It fails to show 2 million.

Is it clear now?

 
Anton Zverev:

Please think about how to improve MQL so that this weak link disappears and the product becomes really complete. I suggested my own variant, but yours is 100% more thoughtful.

In fact, the change that needs to be implemented is quite simple - the OnBookEvent event should be called not only upon change of the put, but when a new tick comes on the instrument to be signed. Due to this event it is already possible to catch the arrival of new ticks from other symbols on FORTS (where there is the market).

If we are on FOREX and there is no tick, OnBookEvent is called at arrival of a new tick. If we are at the exchange - OnBookEvent is called when the market rate changes. That's all.

 

It would be much more convenient if for each symbol, the terminal would keep a tick counter (since the moment of connection). And each Expert Advisor, when called, would get the number of the tick, on which it was called.

This would allow estimating the missed ticks.

Right now, every EA is required to be triggered on a chart. BookEvent is the first swallow, saying that no charts are required to run EAs.

 
Anton Zverev:

I want the EA to be called on every tick of the second symbol.

I am using IndicatorRelease on the second symbol. It creates ChartEvent event on each tick of its symbol. The Expert Advisor, respectively, catches this event.

This poor solution was suggested many years ago, according to the search results. I haven't found another working solution. If the test should be conducted on 10 symbols, then 9 indicators are launched.

Suppose we have an Expert Advisor that increases the counter on every tick.

I am running it on one symbol in the tester, where it is 1 million ticks. The counter shows 1 million.

I also reached another symbol and it shows 1 million.

I put it through two symbols at once. It fails to show 2 million.

Is it clear now?

The Expert Advisor will be called on every tick of the second symbol only if it is attached to the chart of the second symbol.

You don't need to bother with any chart-events. Everything has already been done before you, you just have to look around.

1. For example, you make a 1-second timer.

2. You arrange a loop from zero to 100 in OnTimer with Sleep(10) and control it to not run longer than 1 second.

3. Analyse any tools you like using SymbolInfoTick queries.

This construction will also work in the tester.

PS it's better to make the timer for a longer period, for example for 3600 seconds.

And the loop must be organized for not a second, but for less than an hour. With obligatory check IsStopped()

Sleep, by the way, is mandatory. Otherwise you will hang the tester. Well, the system resources will be eaten up during usual work of the Expert Advisor.

Reason: