Two possibilities are:
Volume is the count of ticks that are:
1. sent out by the broker's server
2. received by the client terminal
[...]
What thoughts do you guys have about this?
You're probably fed up of hearing my views on the subject, but a bit of investigation suggests that there may actually be a third option, albeit one which is closer to the second of your scenarios than the first.
I've tried the following: disable internet connection, use a script to get the last value of Volume[0] (on something like an H1 chart) which MT4 received before the connection was lost, wait a few minutes, and then restart MT4 and watch the Volume[0] numbers which come in. The results I got were a figure of 5561 for the last tick before the connection went down, followed by the following tick numbers once the connection restarted: 5562, 5564, 5565, 5566, 5566, 5567, 6221, 6222.
I think that the jump from 5567 to 6221 is a result of MT4 loading historic data in the background once the connection has been established. Until that's been done, it seems to be working out its own Volume[0] figure based on the last one it saw. It's not clear whether the revised figures from 6221 onwards are entirely provided by the broker, or are partially calculated by MT4 itself via e.g. adding together the volume for historic M1 bars which it receives, and then incrementing for each new tick which is received. It could be a mix of broker transmission and MT4 receipt.
This could complicate matters. If MT4 is building its own tick volumes from M1 bars, and your test is running on M1 bars, then the lack of gaps in your Terminal0 data doesn't necessarily imply that Terminal0 is receiving every tick. This hypothesis is partially supported by the fact that Terminal1 has two ticks missing between 5 and 7.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
In MetaTrader, Volume is the count of ticks within a bar.
However, this definition is a little ambiguous.
Two possibilities are:
Volume is the count of ticks that are:
1. sent out by the broker's server
2. received by the client terminal
Remember that ticks can be lost or discarded for a number of reasons, so depending on which of the above definitions are true, the values would be different.
I decided to do a tick reception test using two different terminals on two different computers connected to the same broker server and same live (real money) account and using the same tick recording indicator.
The computer for Terminal 0 is my main computer connected to the internet. The MetaTrader terminal has 5 charts open. This computer actually acts as the internet proxy server for the Terminal 1 computer.
The computer for Terminal 1 must access the internet through the Terminal 0 computer. The MetaTrader terminal has many charts open (one for every currency pair available).
I entered part of the results into an Excel spreadsheet and tried to match up the data by inserting blank cells where appropriate. You can see a screenshot of the spreadsheet below.
Tick Reception Comparison
The red text is where there is a difference in value.
You can see that all data for each existing tick match exactly except for Volume.
You can also see that for Terminal 1, when comparing with the Terminal 0 data, there are two ticks missing between the Volume = 5 and Volume = 7 ticks, even though based on the Terminal 1 Volume numbers there is only one missing (the Volume = 6 tick).
So what is the explanation for this?
If the value of the Volume variable is sent out by the broker's server (and not calculated by the client terminal), why do I see different values of Volume on different terminals for the same (time, Bid, Ask) combination?
When I look at the list of Market information identifiers that are used with MarketInfo() function, there is nothing for Volume, even though there is for Time, Bid, Ask, and others. Is the MarketInfo data the only data that is sent out by the server?
If Volume is actually calculated by the client terminal, I'm thinking that between the Volume = 5 and Volume = 7 tick, there was one tick that was received but discarded, and the other tick was not received at all i.e. lost in transmission.
Also, what would be the reason for the lost/discarded ticks on Terminal 1? Could it be because there are so many charts open on that terminal?
It's the discarding of ticks that worries me. Ideally I would like my MetaTrader terminals to receive every single tick that is sent out by the broker, but is this possible?
What thoughts do you guys have about this?