Someone familiar with Metastock may correct me, but by the looks of it, you have a "BUFF" function that looks at the 32 most recent bars, adds up the volume times the close price for them, and divides that by the total volume for those bars. It could look like the following in MT4:
PHP Code:
double buff()
{
double sum = 0;
double v = 0;
for ( int i = 0; i < 32; i++ ) {
sum += Volume[ i ] * Close[ i ];
v += Volume[ i ];
}
return( sum / v );
}