More Information about:
Link: 1) www.virtuosclub.ru/main/ind/W/whipplevolumeplotwhipplevolumeaverage2f/





Source Code "Whipple Volume Average":

function init()
{
   with (WVA) {
     createBuffer("WVA");
     setBufferColor("WVA", "lime");
     setBufferDrawStyle("WVA", DrawStyle.LINE);
     setAutoChangeMaxMin("WVA");

     createParameter("Period", 10);
   }
}

function start()
{
   WVA.label = "Whipple Volume Average (" + WVA.parameter("Period") + ")";
   WVA.addLevel(0, "white");

   var num = Shared.numberOfQuotes();
   var WVABuf = new Array(num);

   var CloseBuf = Shared.close();
   var VolumeBuf = Shared.volume();

   for (var i = 1; i < num; ++i) {

     if (CloseBuf[i] < CloseBuf[i-1]) WVABuf[i] = 0 - VolumeBuf[i];
     if (CloseBuf[i] > CloseBuf[i-1]) WVABuf[i] = VolumeBuf[i];
     if (CloseBuf[i] == CloseBuf[i-1]) WVABuf[i] = 0 ;
   }

   WVABuf = Shared.ema(WVA.parameter("Period"), WVABuf);

   WVA.setBufferData("WVA", WVABuf);
}