Registered User Joined: 10/7/2004 Posts: 22
|
Thanks for all the help in advance.
I am looking for a formula to create an indicator for Volume Weighted Average Price(VWAP).
Please help
|
|
Worden Trainer
Joined: 10/1/2004 Posts: 18,819
|
How would you like the average weighted? Can you give me some more details on how this is calculated so I can try and translate it to the program for you?
- Craig Here to Help!
|
|
Registered User Joined: 10/7/2004 Posts: 22
|
I am specifically looking for a trade by trade weighted average of volume and price. I have been doing a lot of research lately and I have found that pension funds and hedge funds use an indicator to keep a record of the daily price weighed by volume. I would personally like the indicator to take the price times the volume per bar and individually weigh each bar in the average. so, if I am looking at the intraday chart on a 5 minute, then I want the volume weighted price average for the hour or day. If I am looking at the daily chart, I want to look at variations or the weekly and monthly average, which I want to choose. I want to know what the weighed average price is for the period. Hedge funds and pension funds take this as a gauge of the price paid for a security. over the indicator is more then it is currently worth and under is a good buy.
Thanks,
Amir
|
|
Worden Trainer
Joined: 10/1/2004 Posts: 4,308
|
A formula could be constructed to average volume weighted price. However, formulas in TeleChart do not work with intraday bars such as 5 minute bars.
- Doug Teaching Online!
|
|
Registered User Joined: 10/7/2004 Posts: 22
|
What is that formula? If I am viewing intraday data and this is my indicator, wouldnt it be using the current bars, which would be intraday?
Thanks,
Amir
|
|
Worden Trainer
Joined: 10/1/2004 Posts: 18,819
|
Finally found the VWAP. Here is the definition I found on investopia:
QUOTEA trading benchmark particularly used in pension plans. VWAP is calculated by adding up the dollars traded for every transaction (price times shares traded) and then dividing by the total shares traded for the day. The theory is that if the price of a buy trade is lower than the VWAP, it is a good trade. The opposite is true if the price is higher than the VWAP.
There is no way to isolate each tick then divide by the total volume of the day.
I played around and came up with this:
(C*sqr(V))/sqr(AVGV100)
Plot as a custom indicator in the top window and be sure to check the option to use the price scale. I set the smoothing average to 30.
It made for an interesting chart. Based on what the site says, on some stocks, price is in an interesting potential buy position when below the line and less desirable buy position when above it.
- Craig Here to Help!
|
|
Registered User Joined: 10/7/2004 Posts: 22
|
What exactly does that formula do to the data? I am curious. What role does each piece play. I like to understand the logic behind what I am using.
Thanks again,
Amir
|
|
Worden Trainer
Joined: 10/1/2004 Posts: 18,819
|
(note: I forgot to mention the smoothing average, post is edited above to reflect this)
The formula divides the multiple of price and the square of volume by the square of the average volume. The square minimizes the distortions caused by large spikes in volume.
Essentially, each point is weighted by how the volume compares to the average volume.
You can take or leave it. VWAP is not possible to plot but the formula I offered works under a similar idea.
- Craig Here to Help!
|
|
Worden Trainer
Joined: 10/1/2004 Posts: 18,819
|
...also, if you were thinking of weighting the average differently than what I found as the definition of the indicator then I need you to specifically explain how YOU would like the average weighted by the volume.
- Craig Here to Help!
|
|
Registered User Joined: 10/7/2004 Posts: 22
|
I want to take into consideration things like the large spike in volume. Is there any way to have the price multiplied by the volume chart at the price level? It seems that the VWAP is the price multiplied by volume and then divided by volume again, so I am wondering if there is some way to take the sum of say the last 21 periods of price multiplied by volume and then dividing it by the sum of volume for that period.
Thanks,
Amir
|
|
Worden Trainer
Joined: 10/1/2004 Posts: 18,819
|
If I read your suggestion correctly you will be dividing by the same amount of volume you multiplied by. It will leave you with just the value of price.
I will leave you to play with the formula. The syntax is easy. Let us know what you end up using.
- Craig Here to Help!
|
|
Registered User Joined: 10/7/2004 Posts: 799 Location: Duluth, GA
|
Hi, Amir:
Here is the formula for a 21-day VWAP, with Simple averaging:
(C*V + C1*V1 + C2*V2 + C3*V3 + C4*V4 + C5*V5 + C6*V6 + C7*V7 + C8*V8 + C9*V9 + C10*V10 + C11*V11 + C12*V12 + C13*V13 + C14*V14 + C15*V15 + C16*V16 + C17*V17 + C18*V18 + C19*V19 + C20*V20) / AvgV21 / 21
As a PCF, it will give you DAILY values.
You should plot this as a Custom Indicator for other barlengths, then just set the barlength to whatever timeframe you want (including intraday, if you have TCNet). You can use the SortBy function to show the most recent VWAP results for a list of up to 200 symbols on intraday-length bars.
If you're looking to add some logic to this, such as crossovers and the like, just write it up as a daily-bar PCF, then plot it as a Custom indicator. Voila!
Jim Dean
|
|
Registered User Joined: 10/7/2004 Posts: 799 Location: Duluth, GA
|
Also note ... if you plot the CI on the top pane, and turn on the pointer-databox, you can see the value for ANY day in the past just by moving the pointer around.
Jim Dean
|
|
Registered User Joined: 10/7/2004 Posts: 22
|
Thanks Jim. I did something similar a few minutes ago. Wish I saw yours. Wasn't sure if Averaging would get me the same result but it does:
(C1 * V1 + c2 * v2 + C3 * V3 + C4 * V4 + C5 * V5 + C6 * V6 + C7 * V7 + C8 * V8 + C9 * V9 + C10 * V10 + C11 * V11 + C12 * V12 + C13 * V13 + C14 * V14 + C15 * V15 + C16 * V16 + C17 * V17 + C18 * V18 + C19 * V19 + C20 * V20 + C21 * V21)/(V1 + v2 + V3 + V4 + V5 + V6 + V7 + V8 + V9 + V10 + V11 + V12 + V13 + V14 + V15 + V16 + V17 + V18 + V19 + V20 + V21)
Thanks again,
Amir
|
|
Registered User Joined: 10/7/2004 Posts: 799 Location: Duluth, GA
|
Yours is ALMOST the same, Amir ... but it is calculating the VWAP for ONE DAY AGO (you started the series with C1, not C or C0, etc). Maybe that's what you wanted, though.
The trick that I used for the denominator could shorten up your math a bit ... for one day ago the formula would be:
(C1*V1 + C2*V2 + C3*V3 + C4*V4 + C5*V5 + C6*V6 + C7*V7 + C8*V8 + C9*V9 + C10*V10 + C11*V11 + C12*V12 + C13*V13 + C14*V14 + C15*V15 + C16*V16 + C17*V17 + C18*V18 + C19*V19 + C20*V20 + C21*V21) / AvgV21.1 / 21
Jim Dean
|
|
Registered User Joined: 10/7/2004 Posts: 22
|
Thanks again. I saw that and made the adjustment.
|
|
Gold Customer
Joined: 1/25/2005 Posts: 29
|
Craig,
Most technicians that use the VWAP indicator are after one piece of information:
They want to know, for example on a daily chart, how much stock was purchased at each price interval. This allows a technician to visualize whether or not a greater number of traders are under or above the current price. This type of indicator give a technician insight as to whether or not peopl are getting squeezed...lending insight into short and longs...
|
|
Registered User Joined: 11/1/2006 Posts: 14
|
>Most technicians that use the VWAP indicator are after one piece of information:They want to know, for example on a daily chart, how much stock was purchased at each price interval. This allows a technician to visualize whether or not a greater number of traders are under or above the current price. This type of indicator give a technician insight as to whether or not peopl are getting squeezed...lending insight into short and longs...that is what i would like to do. how is this handled in TC2000?
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
TC2000 version 12 has both a VWAP indicator which resets at the beginning of each day and a Moving VWAP indicator which calculates base on the Price and Volume of a fixed number of periods. Both indicators use the Price and Volume Bars of the active Time Frame in their calculation.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 3/12/2012 Posts: 1
|
Price crossing VWAP indicatior. Using TC2000, Platinum, I would like to find stocks where during the last n bars, price was below and above the VWAP and the latest close is above. I would hope for a PCF that might look like:
(MaxH3 > VWAP) AND
(MinL3 < VWAP) AND
(C > VWAP)
However, the system indicates that there is an error.
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
Volume Weighted Average Price is not built into the Personal Criteria Formula Language. The syntax available is listed in the PCF Formula Descriptions topic. If it isn't listed thre, it probably isn't going to work.
We could manually construct formulas for a Moving VWAP indicator if the period and number of bars to check were specified to find out if Price was both above and below the Moving VWAP while being currently above.
We could not create a similar formula for the non-moving version of VWAP. While we could click on Price to create a Condition for price being above the VWAP currently and add 1-Period Simple Moving Averages with offsets to both Price and VWAP to check for past prices being above or below VWAP.
Indicators, Sorting & Scanning
The lack of an OR option in a Scan would prevent us from checking for price being both above and below the VWAP.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 4/28/2013 Posts: 3
|
Has VWAP been added to the Personal Criteria Formula Language in the last year?
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
No, it has not. The Personal Criteria Formula Language in TC2000 version 12.3 is essentially unchanged from TC2000 version 7 with the exceptions that you can set the Time Frame and that Volume is expressed in actual shares instead of blocks of 100 shares.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Registered User Joined: 12/21/2010 Posts: 21
|
If you plat VWAP on the chart as an indicator and then add a scan condition to it, all kinds of options become available. .
|
|
Worden Trainer
Joined: 10/7/2004 Posts: 65,138
|
You are almost always better off adding an indicator to the chart and clicking on it to select Create Scan Condition than creating a Condition Formula. The only exceptions are when you cannot construct the Condition you want by selecting when of the Create Scan Condition options.
-Bruce Personal Criteria Formulas TC2000 Support Articles
|
|
Guest-1 |