StockFetcher Forums · Filter Exchange · Help Buff Moving average or Volume Weighted MA<< 1 2 >>Post Follow-up
rarya
7 posts
msg #57732
Ignore rarya
12/7/2007 8:39:48 AM

Trying to code this up but without any success.
Here is the description from SFO magizine

The volume weighted moving averages (VWMA) or Buff averages is calculated by weighting each time frame’s closing price with the time frame’s volume compared to the total volume during the range:

VWMA = sum {closing price (I) * [volume (I)/(total range)]}, where I = given day’s action.

This is an example of how to calculate a two-day moving average, using both the SMA and VWMA for a security trading at $10 a share with 100,000 shares changing hands on the first day, and at $12 a share with 300,000 shares changing hands on the second day. The SMA calculation is day one’s price plus day two’s price, divided by the number of days, or (10+12) ÷ 2, which equals 11. The VWMA calculation would be day one’s price, $10, multiplied by day one’s volume, which is expressed as a fraction of the total range (100,000/400,000 = 1/4), plus day two’s price, $12, multiplied by day two’s volume of the total range expressed as a fraction (300,000/400,000 = 3/4), which equals 11.5 (2.5 day one + 9 day two).

VW-MACD = Uses Appel's traditional MACD formula and substitutes the EMA's with VWMA's for the first two computations.

VPCI = VPC x VPR x VM

The VPCI (volume price confirmation indicator) involves three calculations derived from two inputs:

Input 1 = long-term timeframe (28 periods standard)
Input 2 = short-term timeframe (seveb periods standard)

Calculation 1, Volume Price Confirmation/Contradiction:
Where VPC is the difference between a long-term volume-weighted moving average (VWMA) and a simple moving average (SMA) of the same length. This difference, when positive, is volume-price confirmation (VPC+); when negative, is volume-price contradiction (VPC-).

Calculation 2, Volume Price Ratio:
The volume price ratio (VPR) is calculated by dividing short-term VWMA a by the short-term SMA.

Calculation 3, Volume Multiplier:
The volume multiplier (VM) is the short-term volume average divided by the long-term volume average.

VPCI = VPC x VPR x VM

Thanks

nikoschopen
2,824 posts
msg #57739
Ignore nikoschopen
12/7/2007 1:17:46 PM

A passing aberration in the guise of déja vu? I swear this question came up in the past, which you can read in full HERE

As for VWMA, Stockfetcher already has one for use.

At any rate, here's the modified code from the other thread:
Fetcher[
set{VPC,vma(28) - ma(28)}
set{VPR,vma(7) / ma(7)}
set{VM,cma(volume,7) / cma(volume,28)}
set{Vpcii,VPC * VPR}
set{Vpci,Vpcii * VM}

add column Vpci
draw Vpci
]


Courtesy of lockwhiz, the entire article (PDF) can be read HERE.

nikoschopen
2,824 posts
msg #57740
Ignore nikoschopen
12/7/2007 5:43:35 PM




Fetcher[
set{VPC,vma(28) - ma(28)}
set{VPR,vma(7) / ma(7)}
set{VM,cma(volume,7) / cma(volume,28)}
set{Vpcii,VPC * VPR}
set{Vpci,Vpcii * VM}

set{VPMA,cma(Vpci,20)}
set{VPSD, 2 * cstddev(VPMA,20)}
set{VBoll_Up,VPMA + VPSD}
set{VBoll_Dn,VPMA - VPSD}

add column Vpci

draw VBoll_Up on plot Vpci
draw VBoll_Dn on plot Vpci
draw Vpci
]


I ain't too sure I got the Bollinger thang correct but it seems to look okay. Any suggestion would be welcome. BTW, can somebody grill the SF developers to allow us the use of indicators like Bollinger Bands on not just prices but on other indicators as well?

rarya
7 posts
msg #57743
Ignore rarya
12/7/2007 5:52:24 PM

nikoschopen

Thanks for the help, I guess that is why they made a search button :)



chetron
2,817 posts
msg #57785
Ignore chetron
12/8/2007 6:00:57 PM

i noticed that the chart lines up better with the CRL example, if you add the line "display weekly chart"


Fetcher[

set{VPC,vma(28) - ma(28)}
set{VPR,vma(7) / ma(7)}
set{VM,cma(volume,7) / cma(volume,28)}
set{Vpcii,VPC * VPR}
set{Vpci,Vpcii * VM}

set{VPMA,cma(Vpci,20)}
set{VPSD, 2 * cstddev(VPMA,20)}
set{VBoll_Up,VPMA + VPSD}
set{VBoll_Dn,VPMA - VPSD}

add column Vpci
add column vboll_dn

draw VBoll_Up
draw VBoll_Dn
draw Vpci

symlist(crl)

display weekly chart
]






mktmole
325 posts
msg #117181
Ignore mktmole
12/3/2013 11:27:48 PM

Any recent ideas on recoding this for the joe-basic subscriber are much appreciated. tks mm

Fetcher[
set{VPC,vma(28) - ma(28)}
set{VPR,vma(7) / ma(7)}
set{VM,cma(volume,7) / cma(volume,28)}
set{Vpcii,VPC * VPR}
set{Vpci,Vpcii * VM}

set{VPMA,cma(Vpci,20)}
set{VPSD, 2 * cstddev(VPMA,20)}
set{VBoll_Up,VPMA + VPSD}
set{VBoll_Dn,VPMA - VPSD}

add column Vpci

draw VBoll_Up on plot Vpci
draw VBoll_Dn on plot Vpci
draw Vpci
and price above 1 and volume above 500,000
]




johnpaulca
12,036 posts
msg #117212
Ignore johnpaulca
modified
12/4/2013 5:03:54 PM

zzzzzzzzz

Kevin_in_GA
4,599 posts
msg #117216
Ignore Kevin_in_GA
12/4/2013 7:29:29 PM

Fetcher[

set{VPC,vma(28) - ma(28)}
set{VPR,vma(7) / ma(7)}
set{VM,ma(7) / ma(28)}
set{Vpcii,VPC * VPR}
set{Vpci,Vpcii * VM}

set{VPMA,cma(Vpci,20)}
set{VPSD, 2 * cstddev(VPMA,20)}
set{VBoll_Up,VPMA + VPSD}
set{VBoll_Dn,VPMA - VPSD}

add column Vpci
add column VBoll_Up
add column VBoll_Dn

vpci crossed above VBoll_Dn
and price above 10 and average volume(30) above 500,000
]



Just remove the draw commands to fix. I upped the price and volume constraints.

mktmole
325 posts
msg #117227
Ignore mktmole
12/4/2013 11:13:59 PM

tks kindly Kevin

Rock Sexton
111 posts
msg #117324
Ignore Rock Sexton
modified
12/10/2013 9:30:58 PM

Interesting filter that Kevin tweaked. So far in my backtesting of it, it's turning up some divergence trades that I like.

I don't trade price-only divergences btw. I concentrate on how far price has moved (i.e. deviations) from important volume points of control. Then I use the divergence setup along with volume confirmation to trade back in the direction of an identified VPOC.

StockFetcher Forums · Filter Exchange · Help Buff Moving average or Volume Weighted MA<< 1 2 >>Post Follow-up

*** Disclaimer *** StockFetcher.com does not endorse or suggest any of the securities which are returned in any of the searches or filters. They are provided purely for informational and research purposes. StockFetcher.com does not recommend particular securities. StockFetcher.com, Vestyl Software, L.L.C. and involved content providers shall not be liable for any errors or delays in the content, or for any actions taken based on the content.


Copyright 2022 - Vestyl Software L.L.C.Terms of Service | License | Questions or comments? Contact Us
EOD Data sources: DDFPlus & CSI Data Quotes delayed during active market hours. Delay times are at least 15 mins for NASDAQ, 20 mins for NYSE and Amex. Delayed intraday data provided by DDFPlus


This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.