How do I get Volume[0] ?

 
How do I get the instantaneous volume of the current minute bar? I tried Volume[0], but it appears that the values are being sampled discretely.
 
vgoklani:
How do I get the instantaneous volume of the current minute bar? I tried Volume[0], but it appears that the values are being sampled discretely.
There is nothing 'instantaneous' about Volume and it is 'sampled discretely' by its very nature. How else would it be sampled?
 

You can't get the total volume until the bar is closed without having access to a flux capacitor, a DeLorian DMC-12 and some plutonium.

use Volume[1] or iVolume(...., 1) to get the volume of the last closed bar.

 

I don't think the volume[0] has useful usage too.

Attached my volume indicator.



Files:
xpvolume.mq4  2 kb
 
Also Volume in FX isn't the same as volume in stock markets. The first is just a count of price changes in that bar. The second is the total shares traded.
 
WHRoeder:
[...] The first is just a count of price changes in that bar. [...]
That's only true for MT4. Most FX platforms (including MT5 btw) show depth of market (volume).
 
gordon:
That's only true for MT4. Most FX platforms (including MT5 btw) show depth of market (volume).
Up to a point. You and WHRoeder are both right. The issue is that there is no centralised book of orders, and therefore any measure of volume is going to be broker-specific in some way or other. You're potentially going to see volume figures which are orders of magnitude different depending on whether you trade through one of the big boys or through a niche broker running a small B book. Or, alternatively, the volume may come in as part of an external price feed, and may bear no relation to the volume going through your broker and the corresponding liquidity which is actually available to you.

(Even with equities and futures, life still isn't simple. Many blue-chip equities have listings on multiple exchanges, with non-trivial volume on more than one, and any volume figure is usually only the volume for a specific exchange. With futures, there can also be different flavours of contract for the same underlying, e.g. different-sized contracts on something like the S&P. Volume is then usually the volume on a specific contract - which may or may not be meaningful to you, depending on how you're planning to use the volume figure.)
 
Agreed, but there are other attributes of depth of market that might be meaningful to certain strategies regardless of the diff between brokers. MT4 volume on the other hand is meaningless (IMHO).
 
gordon:
Agreed, but there are other attributes of depth of market that might be meaningful to certain strategies regardless of the diff between brokers.
Well, yes, but that raises three further issues. Firstly, "volume" and "depth of market" are usually treated and referred to as two separate things, partly because the latter has traditionally been an expensive extra data feed. Secondly, there's a backtesting issue: historic DoM involves enormous quantities of data. Thirdly, the interpretation of DoM depends on whether your orders are ending up in something like Hotspot which matches buyer and sellers in the same manner as any other electronic exchange, or whether your broker is providing some sort of market-making function.
 
I was obviously oversimplifying things, my point being that DOM/Volume on most other FX platforms *might* be used in certain strategies (despite all your valid points) while in MT4 it should not be used (IMHO)...
Reason: