TradingView
LazyBear
2014년 9월 2일 오후 10시 17분

Elastic Volume Weighted Moving Average & Envelope [LazyBear] 

Bitcoin / U.S. dollarBitstamp

설명

Elastic Volume Weighted Moving Average (eVWMA) is a statistical measure using the volume to define the period of the moving average. The eVWMA can be looked at as an approximation to the average price paid per share. Multiplier is usually the number of shares, but it can be approximated using cumulative sum of volume (Enable it via "Use Cumulative Volume" option) or sum of volume over "n" periods.

I have also added an option to draw eVWMA envelope (eVWMA on HLC).

More info:
christian-fries.de/evwma/PDF/evwma_intro.pdf

List of all my indicators:
- Chart: tradingview.com/v/4IneGo8h/
- GDoc: docs.google.com/document/d/15AGCufJZ8CIUvwFJ9W-IKns88gkWOKBCvByMEvm5MLo/edit?usp=sharing
코멘트
grahvity
Oh, CUMULATIVE volume.
I'll show myself out.
LazyBear
lol
mortdiggiddy
This calculation isn't anything new, it is simply the TRUE calculation of the volume weighted moving average. Trading view calculates the VWMA incorrectly as instructed by their own documentation when you search for the vwma() function.

This formula here shows the step-by-step calculation of the VWMA as an incremental/rolling calculation: people.ds.cam.ac.uk/fanf2/hermes/doc/antiforgery/stats.pdf, Eq 4-53

U = Un-1 + w / Wn * (x - Un-1)

let Wn = nb_floating_shares (sum of volume (weight) N bars back)
let w = current volume (current weight)
let x = price
let Un-1 = previous MA calculation
let Un = current MA

from line 12 of this script in the calc_evwma function, substituting the above variables:

U = Un-1 * (Wn - w) / Wn + (w * x / Wn)
= Un-1 / Wn * (Wn - w) + w * x / Wn
= Un-1 - Un-1 * w / Wn + w * x / Wn
= Un-1 + w / Wn * (x - Un-1)

This is the exact same formula in the final value in Equation 4-53 above. This is also the same calculation here tradingsetupsreview.com/volume-weighted-moving-average-vwma/

The Trading View calculation of vwma is wrong, it should be the above. The elastic volume weighted moving average is simply another form of the normal VWMA formula, it is not a new moving average.
chrysopoetics
@mortdiggiddy, so what you're saying is that this script is the true implementation of the VWMA (using cumulative volume or the sum of the volume over a specified length?) and the code above is the correct implementation of the eVWMA?

Sorry to be extra-dense, but would it be possible for you to script-up the correct implementation of the eVWMA (or whatever it is you've commented above)?

And thank you for sharing those articles. I love when people leave gold in the comments.
xel_arjona
@mortdiggiddy, Indeed, If you plot the cumulative sum version (All timeSeries from within it's origin price) side by side with VWAP, you will have quite much the same result. Tony Finch's paper is a jewel, it defines and proofs why this kind of incremental rolling could have better computation performance in their AutoRegressive algorithm model. (EWMA for math-statistics, 1-pole Infinite Impulse Response for math-frequentists). Can't remember name of paper for the computational proof for this, but google is always your friend. ;)
zfadeview
@mortdiggiddy, I’m new here, so please correct me if I’m wrong.

According to the definition of eVWMA presented in the paper, “Wn” here should be a constant, i.e. total number of shares, that doesn’t have to do with sum of Wi (which would be the total volumes of interest). With Wn != sum of Wi, the equations above do not check out. Hence, it’s more like a volume weighted “cumulative” average (or a special case of VWMA, where all historical volumes are considered), plus a decaying effect on previous trades. Does it make sense?
cooney_s
This IS a VERY useful indicator. If you want to trade in a very simple and smart manner, this indicator will help you massively in your trading efforts. Read up on MIDAS is the best thing you can do to under stand how to implement this tool. In a nutshell, only enter a trade when price converges with the line plotted by this indicator. It signifies a "true" value in price. One caveat, you can only use this tool on instruments where volume is measured. So Spot Forex is not compatible ((typical of Forex, not this indicator)), unfortunate for Forex traders, but perhaps that crowd can use a futures equivalent.

Thanks LazyBear for the addition!!!
ChartArt
eVWMA looks very useful in my first test. Thanks as always for sharing with us.
joe_vijay
Wonder what is the use of this indicator? Is it for showing oversold/bought conditions, S/R levels?
LazyBear
This is moving average. You can substitute this in any xMA strategy.
더보기