Thank you for posting this seismic indicator.
One minor thing that I noticed...
I see volume and tick_volume referenced in the code but they both return tick volume data. This appears to be a nonsensical "feature" of the MQL5 language.
In contrast, iRealVolume() returns real volume.
Thank you for posting this seismic indicator.
One minor thing that I noticed...
I see volume and tick_volume referenced in the code but they both return tick volume data. This appears to be a nonsensical "feature" of the MQL5 language.
In contrast, iRealVolume() returns real volume.
You're absolutely right about the MQL5 nuance. In Forex (OTC markets), volume[] and tick_volume[] are indeed identical since there's no centralized exchange. However, for Stocks. Futures, and other exchange-traded instruments, volume[] will return real volume when available. Our fallback logic handles both scenarios gracefully. Thanks for the sharp observation!
Thanks. Got it. I was confounding volume[] with iVolume().
| volume[] [in] Array with trade volume values. | OnCalculate - Event Handling - MQL5 Reference |
| iVolume Returns the tick volume of the bar (indicated by the 'shift' parameter) on the corresponding chart. Forum on trading, automated trading systems and testing trading strategies IVolume vs iTickVolume ve iRealVolume Fernando Carreiro, 2025.11.14 02:17 iVolume() and iTickVolume() are the same thing, and the reason is for backwards compatibility with MQL4 which used iVolume(). "Tick volume" is a count of ticks while "Real volume" is the real volume transacted on the exchange. Forex and CFDs don't have real volume (only tick volume), while for example, Futures and Stocks have both. | iVolume - Timeseries and Indicators Access - MQL5 Reference |
Therefore, those MQL5 language elements are not nonsensical.
Thanks. Got it. I was confounding volume[] with iVolume().
| volume[] [in] Array with trade volume values. | OnCalculate - Event Handling - MQL5 Reference |
| iVolume Returns the tick volume of the bar (indicated by the 'shift' parameter) on the corresponding chart. | iVolume - Timeseries and Indicators Access - MQL5 Reference |
Therefore, those MQL5 language elements are not nonsensical.
Correct. Let me clarify the precise difference because there is a common misconception even among professional developers:
In MQL4, Volume[] and iVolume() refer to the same data type (Tick Volume). The difference is only in the "scope":
-
Volume[] : Functions only on the current chart (current symbol and timeframe) and is generally faster inside loops.
-
iVolume() : Retrieves volume from any symbol and timeframe, not just the active one.
In MQL5, this is where the confusion arises. The naming convention can be misleading because the data types are different. Inside OnCalculate() , two volume arrays are passed:
-
tick_volume[] : Represents Tick Volume (count of incoming ticks).
-
volume[] : Represents Real (Exchange) Volume. In the decentralized Forex market, this is often empty or zero.
The Comparison: The function iVolume() in MQL5 returns Tick Volume by default. Therefore:
-
tick_volume[] (inside OnCalculate) IS indeed synonymous with iVolume() .
-
volume[] (inside OnCalculate) IS NOT synonymous with iVolume() .
To clarify, this indicator uses the volume[] and tick_volume[] arrays passed directly to OnCalculate() , not the iVolume() function.The fallback logic uses:
(volume[i] > 0) ? volume[i] : tick_volume[i] Which correctly prioritizes Real Volume for Stocks/Futures, and gracefully falls back to Tick Volume for Forex/CFDs where Real Volume doesn't exist. This is my understanding based on the documentation. I welcome any corrections if I missed something.
Based on your feedback, I've updated the documentation in the source code to clarify this nuance. Thanks for helping improve the codebase!
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Adaptive VWAP Institutional:
Adaptive VWAP Institutional: Multi-Asset Auto-Detection & DST-Accurate Session Resets (Forex 5PM NY Standard).
Author: awran5