New Version of MetaTrader 4 Client Terminal Build 419 - page 3

 
RaptorUK:

That isn't from the experts log file . . . unless you edited it significantly . . .

The log file fills from the top to bottom, the tabs, expert tab, journal tab, etc fill from the bottom to the top. What you have pasted here is filled from the bottom to the top (oldest entry at the bottom) suggesting it is from the experts tab . . . not from the log file.

The log files are complete while the information in the tabs can often be incomplete as they cannot keep up with the flow of data . . . the log file is the acid test, if it shows you have an issue then maybe you do.

Here it is, directly from experts\logs directory:

22:33:50 testTicks EURUSD,M1: removed
22:34:02 testTicks EURUSD,M1: loaded successfully
22:34:02 testTicks EURUSD,M1: initialized
22:34:05 testTicks EURUSD,M1: [1] 1.31313
22:34:11 testTicks EURUSD,M1: [2] 1.31315 <---
22:34:13 testTicks EURUSD,M1: [6] 1.31326 <--- 3 ticks missing !
22:34:18 testTicks EURUSD,M1: [7] 1.31324
22:34:22 testTicks EURUSD,M1: [8] 1.31326
22:34:32 testTicks EURUSD,M1: [9] 1.31324
22:34:34 testTicks EURUSD,M1: deinitialized
22:34:34 testTicks EURUSD,M1: uninit reason 4
22:34:34 testTicks EURUSD,M1: removed

 

I want to remind what manual tells with regard to this issue:

"The Advisor will not be launched for a new, tick if it is processing the previous one at this moment (i.e., the Advisor has not completed its operation yet)"


It was acceptable 5 or 8 years ago, but unacceptable nowadays when number of ticks increased dramatically. When you're making your trading decisions based on market data you expect not to miss any single tick. Don't you? That's why I say it's a bug which must be fixed as soon as possible.

 
I get an occasional "missing" tick with Build 409 also . . . perhaps it is not missing but happens simultaneously, a tick isn't only a change in price, as far as I am aware, it can be a change in other parameters.
 

This problem is not isolated to 409 Build. I also tested it on 419, results are pretty much the same.

12:31:13 testTicks EURUSD,M1: [1] 1.31587
12:31:16 testTicks EURUSD,M1: [2] 1.31585
12:31:20 testTicks EURUSD,M1: [3] 1.31582
12:31:21 testTicks EURUSD,M1: [6] 1.31574
12:31:30 testTicks EURUSD,M1: [7] 1.31576
12:31:30 testTicks EURUSD,M1: [8] 1.31579
12:31:43 testTicks EURUSD,M1: [10] 1.31585
12:31:49 testTicks EURUSD,M1: [11] 1.31587
12:31:50 testTicks EURUSD,M1: [13] 1.31593
12:31:50 testTicks EURUSD,M1: [14] 1.31596
12:31:57 testTicks EURUSD,M1: [17] 1.31588
Imagine that there was a price high in-between 14 and 17 ticks which is now missing. That would affect any high-frequency trading model substantially.
 

Found a Big on MetaTrader Editor

If you have a large expert open( 300 + lines) and you try to use the Replace ( Ctrl+H) functions it now hangs, go into a loop and never comes out .

Can some one else duplicated the problem with this build please.

 
traderjoel:

I want to remind what manual tells with regard to this issue:

"The Advisor will not be launched for a new, tick if it is processing the previous one at this moment (i.e., the Advisor has not completed its operation yet)"


It was acceptable 5 or 8 years ago, but unacceptable nowadays when number of ticks increased dramatically. When you're making your trading decisions based on market data you expect not to miss any single tick. Don't you? That's why I say it's a bug which must be fixed as soon as possible.

Use ...

RefreshRates ();

MetaEditor > navigator window > dictionary tab > MQL4 Reference > Window functions > RefreshRates

 

I found some more evidence in the manual that this is an intentional bug. Here is an excerpt from the MQL4 Reference > Program Run > Program Run:

At incoming of new quotes, the start() function of the attached experts and custom indicators will be executed. If the start() function launched at the preceding quote was running when a new quote came, the new quote will be skipped by the expert. All new quotes income while the program was being executed are skipped by the program until the current execution of the start() function has been completed. After that, the start() function will be run only when a successive new quote incomes. For custom indicators, the start() function will be launched for recalculation after the current chart symbol or timeframe has been changed independently on new quotes incoming. The start() function will not be run when the expert properties window is open. The latter cannot be opened during the expert execution.

RefreshRates() won't help in this case as ticks are just skipped and not processed.

By the way, MQL5 has the same problem:

Client Terminal Events

NewTick

The NewTick event is generated if there are new quotes, it is processed by OnTick() of Expert Advisors attached. In case when OnTick function for the previous quote is being processed when a new quote is received, the new quote will be ignored by an Expert Advisor, because the corresponding event will not enqueued.

All new quotes that are received while the program is running are ignored until the OnTick() is completed. After that the function will run only after a new quote is received. The NewTick event is generated irrespective of whether automated trade is allowed or not ("Allow/prohibit Auto trading" button). The prohibition of automated trading denotes only that sending of trade requests from an Expert Advisor is not allowed, while the Expert Advisor keeps working.

The prohibition of automated trading by pressing the appropriate button will not stop the current execution of the OnTick() function. OnTick() is not started when the window of Expert Advisor properties is open. The window of properties cannot be opened when the Expert Advisor is running.


MetaQuotes, can you fix this bug? Or at least create a workaround for those who wish to process all incoming ticks.

 

traderjoel:

MetaQuotes, can you fix this bug? Or at least create a workaround for those who wish to process all incoming ticks.

Why not operate your own workaround . . . stay in start and wait for new ticks to arrive . . .
 
How? Can you give me an example?
 
traderjoel:

[...] an intentional bug. [...]

This is one of those things where a bug is in the eye of the beholder. MetaQuotes don't consider that it's a bug; MT4 is working as they intend it to work.

What you are requesting has serious side-effects. If the start() function in an EA or indicator becomes re-entrant, then the MQL language and framework also needs to gain various complex synchronisation mechanisms, and MQL4 programming becomes a lot harder. For example, any variable which is not local to a function can then potentially be acted on concurrently by multiple calls to start(), and there needs to be a locking mechanism available. The lack of re-entrancy is one of the many deliberate trade-offs which MQL4 makes between simplicity and flexibility/performance. You call it a bug; personally, I call it elegant simplicity.

There's absolutely no likelihood of MetaQuotes changing this. It's extremely probable that things like the currently-selected order - i.e. the most recent OrderSelect() - are recorded on a per-EA basis and would have to be substantially re-worked so that separate concurrent calls to start() could have their own order-selection context.

It also ties in with the endless discussions of what volume means in MT4. If you think that you need access to every single "tick" - whatever that happens to mean with your broker - then why don't you think that you need access to the top of book rather than just the BBO?

Reason: