volume indicator source

 
Hi,

I read what I could find on the volume indicator in Metatrader, and that seems to suggest the Volume refers to the number of ticks per unit time, rather than the amount of lots traded per unit time.

Is there a clearer definition of this indicator?

Thanks,

Tom
 
Yes.

It is the "number of ticks" during the period.

An indicator runs on every tick (not 100% true, but close enough for this illustration):

Run this code on a 1 minute chart of EURUSD:


  

#property indicator_chart_window

int tickCount;
bool start;
double oldTime;
double oldPrice;
int priceChange;
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
	start = true;	
   return(0);
  }

int deinit()
  {
   return(0);
  }

int start()
  {  
	tickCount++;
	
	if(oldPrice != Close[0]){
		oldPrice = Close[0];
		priceChange++;
	}
		
	
	// Reset at startup
	if(start == true){
		tickCount = Volume[0];
		priceChange = Volume[0];
		oldTime = Time[0];
		start = false;
	}
	
	//Reset for new Bar
	if(oldTime != Time[0]){
		oldTime = Time[0];
		tickCount = Volume[0];
		priceChange = Volume[0];
	}
	
	Comment(	 "Volume =        "+DoubleToStr(Volume[0],0)+
				"\nTickCount =     "+tickCount+
				"\nPriceChange =  "+priceChange+
				"\nMinute =         "+TimeMinute(Time[0]));
	
   return(0);
  }



It counts the number of times the code is run, due to a "tick" going to the chart.
It prints the current value of "Volume"
You will find that the two values are almost always identical.
That would not be the case if Volume represented number of contracts or size of contracts, etc.
MT4 "Volume" is a count of ticks during a period