Volume Adjusted Moving Average for Amibroker (AFL)
kaiji over 16 years ago Amibroker (AFL)
Volume Adjusted Moving Average
By kysiek
Screenshots
Indicator / Formula
Copy & Paste Friendly
Period = Param("Period", 50, 1, 100);
agg = 0;
for (i = 0; i < BarCount; i++)
{
Vama[i] = 0;
}
for (i = 1; i < BarCount; i++)
{
agg = agg + Volume[i];
}
ave = agg / (BarCount - 1);
for (i = 1; i < BarCount; i++)
{
weight_day[i] = int((Volume[i] / ave) - 0.5) + 1;
}
agg = 0;
for (i = 1; i < BarCount; i++)
{
index = i;
Copy_wd = weight_day;
for (j = 0; j < Period; j++)
{
if (Copy_wd[index] == 0)
{
index--;
};
agg = agg + C[Index];
Copy_wd[index]--;
}
Vama[i] = agg / Period;
agg = 0;
}
Plot(Vama, "Vama", ParamColor("Vama", colorRed), 1);
Plot(C, "Price", ParamColor("Price", colorBlack), 1);
Plot(MA(C, Period), "Ma", colorBlue, 1);
Short = Cover = 0;
Buy = Cross(C, Vama);
Sell = Cross(Vama, C);0 comments
Leave Comment
Please login here to leave a comment.