I found it strange that my EA cannot read volume during tests, although, the Strategy Tester is showing it. That means I have good data.
Is this expected? I am implementing inside the onTick() event. I am having all attributes of the tick, except the volume. I am using MT5.
In the images is the volume correct being showing in Strategy Tester and 0 in the EA when I am debuging it.
![MT5 : ticks data questions, issues and bugs. All about ticks. - What I've learned from MT5: No EA is reliable if sl or tp are smaller than (high-low) tested on MT5 : ticks data questions, issues and bugs. All about ticks. - What I've learned from MT5: No EA is reliable if sl or tp are smaller than (high-low) tested on](https://c.mql5.com/36/79/mt5-ticks-data-questions-issues.jpg)
- 2018.11.26
- www.mql5.com
It works just fine. It's probably a bug in your code.
However, please note that there is a difference between tick volume and real volume. Forex and CFD's don't usually have real volume, only tick volume.
It works just fine. It's probably a bug in your code.
However, please note that there is a difference between tick volume and real volume. Forex and CFD's don't usually have real volume, only tick volume.
Not bug in my side. I am debugging a MT5 object, the MqlTick itself.
Probably is a misunderstanding of how it works.
I found an explanation:
-
The Forex market is decentralized, which means there isn't a single unified exchange reporting volume data. The volume you see in MT5 represents the trading activity of participants within your broker's liquidity pool, not the entire Forex market. This volume might not be an accurate representation of market-wide activity.
-
Volume vs. Tick Volume: In the Forex market, the concept of volume is different from stock markets. Instead of representing the total number of contracts or lots traded, it often reflects the number of price updates (ticks) that have occurred. This is sometimes called "tick volume".
So I believe that, in Forex, I will not have the volume because each tick counts as 1. It stock market I might get it. Do you confirm it, Dominik?
I found an explanation:
-
The Forex market is decentralized, which means there isn't a single unified exchange reporting volume data. The volume you see in MT5 represents the trading activity of participants within your broker's liquidity pool, not the entire Forex market. This volume might not be an accurate representation of market-wide activity.
-
Volume vs. Tick Volume: In the Forex market, the concept of volume is different from stock markets. Instead of representing the total number of contracts or lots traded, it often reflects the number of price updates (ticks) that have occurred. This is sometimes called "tick volume".
So I believe that, in Forex, I will not have the volume because each tick counts as 1. It stock market I might get it. Do you confirm it, Dominik?
Interesting. Price and volume are the two most important things for many successful traders.
I also noticed that the MqlTick.last field is not populated when live. With the strategy tester it is populated, though.
I believe it is a similar case with the volume data. As it is OTC market and decentralised, the last price would not be very accurate.
Now I don't understand why the strategy tester populates it. Is it to simplify testing? Maybe to help simulating the price paid during the buy/sell?
In my use case it does not help. I was counting with this field to develop my strategies, now it seems I cannot use it.
All I wrote are only hypothesis. I would to hear an opinion/confirmation of you guys.
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
I found it strange that my EA cannot read volume during tests, although, the Strategy Tester is showing it. That means I have good data.
Is this expected? I am implementing inside the OnTick() event. I am having all attributes of the tick, except the volume. I am using MT5.
In the images is the volume correct being showing in Strategy Tester and 0 in the EA when I am debugging it.