no, right; it will need to compute the value relative to prior bars, and assign BUFF with the values.... like
PHP Code:
int start()
{
for ( int bar = Bars - IndicatorCounted(); bar >= 0; bar-- ) {
indicate( bar );
}
}
void indicate(int bar)
{
double sum=0;
double v=0;
for ( int i=0; i<32; i++ ) {
sum += Volume[ bar + i ] * Close[ bar + i ];
v += Volume[ bar + i ];
}
BUFF[ bar ] = sum/v;
}
Just replace your start() function with the above two functions, and it should do the trick.