Download MetaTrader 5

Adding volume

To add comments, please log in or register
Abraham 2011.09.05 12:32 

I'm trying to add volume in a function like this:

double vol(int o,int k,const long &tick_volume2[])

   for(int i=0;i<o;i++)
   Buffer3[k] += (double) tick_volume2[k-o];

This works but the problem is that "+=" means that the active candle goes crazy. With every tick, the volume adds itself so the graph goes crazy rather than count all the ticks at the end of the candle.

Does anybody have any idea how to stabilize the live section of the graph?

Ilyas 2011.09.07 17:34  

Hint, you can write your function easier:)

return(Buffer3[k] += (double) tick_volume2[k-o] * o);
To add comments, please log in or register