Moving Average Weighted, Volume Adjusted

Category: Indicators By: Nicolas Created: October 17, 2022, 7:50 AM
October 17, 2022, 7:50 AM
Indicators
3 Comments

VAWMA = VWMA and WMA combined.
Simply put, this attempts to determine the average price per share over time, weighted heavier for recent values.
Uses triangular algorithm to taper off values in the past (same as WMA does).

Why use this?
Let’s say the earliest bar of the VWMA has a huge amount of volume . That means that when the next bar arrives, there will be an abrupt change in the moving average that doesn’t represent the current value properly. VAWMA eliminates this problem by triangular weighting each bar.

(description from original author: Electrified, all credits to him).

//PRC_VAWMA | indicator
//17.10.2022
//Nicolas @ www.prorealcode.com
//Sharing ProRealTime knowledge
//converted from pinescript 

// --- settings 
len = 50 //Length
// --- end of settings 

src = medianprice
sum = 0.0
vol = 0.0
for m = 1 to len // m = triangular multiple
 i = len - m
 v = volume[i] * m
 vol = vol + v
 sum = sum + src[i] * v
next

return sum/vol as "VAWMA"

 

 

Download
Filename: PRC_VAWMA.itf
Downloads: 203
Nicolas Master
I created ProRealCode because I believe in the power of shared knowledge. I spend my time coding new tools and helping members solve complex problems. If you are stuck on a code or need a fresh perspective on a strategy, I am always willing to help. Welcome to the community!
Author’s Profile

Comments

Logo Logo
Loading...