Skip to main content

Buff Volume Weighted Moving Averages for Amibroker (AFL)

kaiji over 16 years ago Amibroker (AFL)

  • Rating:
    3 / 5 (Votes 3)
  • Tags:
    amibroker, moving average

Buff’s volume-weighted average function has three inputs, price, vol and length. The Fast and slow period inputs represents the number of bars to use in the volume-weighted average calculation. Trader use a combination of 5 and 20 representing Fast and Slow periods respectively.

Credit goes to Prakash Shenoi

Indicator / Formula

Copy & Paste Friendly
/* Buff's Moving Averages */
/* Afl Code - Prakash Shenoi */

f=Param(" Fast Periods  ",5,1,100); 
fa=Sum(V*C,f)/Sum(V,f); 
s=Param("Slow Periods ",10,1,50);
sl=Sum(V*C,s)/(Cum(V)-Ref(Cum(V),-s));
Plot (fa,"fast MA",1,1);
Plot (C,"close",5,64);
Plot (sl,"Slow MA",3,1);
GraphXSpace=3;
Title=Name ()+ "  Buff Averages  "+"\n"+ "Close = " + WriteVal  (C,1.2) +  " Fast MA =  " + WriteVal  (fa,1.2) + "  Slow MA = "+ WriteVal (sl,1.2);

0 comments

Leave Comment

Please login here to leave a comment.