log in     sign up for free
 
The more disciplined you can get, the better you are going to do in the market. The more you listen to tips and rumors, the more money you're likely to lose.
David Ryan
 
 
Home
systems (285)
 
 
Special offer: buy AmiBroker and EOD+Real-Time Data
Formula Library
 
AmiBroker
MetaTrader
MetaStock
TradeStation
Wealth-Lab
NinjaTrader
 
add your formula
System Library
 
 
Account login
Your email:
Password:
 
Log in
New to s4t? Sign up.
If you forgot your password click here.
Search the Web
 
Custom Search

Volume Weighted Average Price

Formula for: TradeStation

indicator

 

 

Views:  2657

Added: August 23, 2008
 
Rate this code:  Rate: 1 Rate: 2 Rate: 3 Rate: 4 Rate: 5
This formula has not been rated yet
 

email this link

 
 
Tags: TradeStation, indicator
 


The VWAP (Volume Weighted Average Price) is a measure of the price at which the majority of a given day's trading in a given security took place. It is calculated by adding the dollars traded for the average price of the bar throughout the day ("avgprice" x "number of shares traded" per bar) and dividing the total shares traded for the day.

How it works:The VWAP (Volume Weighted Average Price) is a measure of the price at which the majority of a given day's trading in a given security took place. It is calculated by adding the dollars traded for the average price of the bar throughout the day ("avgprice" x "number of shares traded" per bar) and dividing the total shares traded for the day.

The indicator requires a security with volume. it is used mostly with stocks. It is more accurate with smaller bar compressions. When calculated tick by tick, you will have the most accurate value, but 1 minute charts work very well. You may want to make sure the Volume setting for the symbol is set to Trade Volume, not Tick Count.

The indicator is recalculated every day so it won't work on daily, weekly or monthly compressions.

The method is used by institutional traders, who often break a given trade into multiple transactions. 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.

This indicator uses smart styling to change the color of the indicator based on the proximity of the indicator to the average price of the bar.

Included is the function that calculates the VWAP, you can use this function to create strategies or other studies. The function has no input parameters.



Type : Function, Name : VWAP_H

vars:
PriceW(0),
ShareW(0),
Answer(0);

if date > date[1] then begin
PriceW = 0;
ShareW = 0;
end;

PriceW = PriceW + (AvgPrice * (UpTicks+DownTicks));
ShareW = ShareW + (UpTicks+DownTicks);

if ShareW > 0 then
Answer = PriceW / ShareW;

VWAP_H = Answer;






Type : Indicator, Name : VWAP

inputs:
UpColor(Blue),
DownColor(Red);

vars:
Answer(0);

Answer = VWAP_H;

if AvgPrice >= Answer then
SetPlotColor(1,DownColor)
else
SetPlotColor(1,UpColor);

Plot1(Answer,"VWAP");






Inputs:
UpColor(Blue) - Color for when the average price of the is below the VWAP
DownColor(Red) - Color for when the average price of the bar is above the VWAP

Plots Descriptions:
Plots the historical VWAP value on an intra-day chart.

Suggested Modifications:
Add a smoothing average.

About the Author/Submitter:
EasyLanguage provided as an example only by TradeStation Technologies. No recommendation or endorsement of this idea should be implied.

 

 



Code:


Type : Function, Name : VWAP_H

vars:
PriceW(0),
ShareW(0),
Answer(0);

if date > date[1] then begin
PriceW = 0;
ShareW = 0;
end;

PriceW = PriceW + (AvgPrice * (UpTicks+DownTicks));
ShareW = ShareW + (UpTicks+DownTicks);

if ShareW > 0 then
Answer = PriceW / ShareW;

VWAP_H = Answer;






Type : Indicator, Name : VWAP

inputs:
UpColor(Blue),
DownColor(Red);

vars:
Answer(0);

Answer = VWAP_H;

if AvgPrice >= Answer then
SetPlotColor(1,DownColor)
else
SetPlotColor(1,UpColor);

Plot1(Answer,"VWAP");






Inputs:
UpColor(Blue) - Color for when the average price of the is below the VWAP
DownColor(Red) - Color for when the average price of the bar is above the VWAP

Plots Descriptions:
Plots the historical VWAP value on an intra-day chart.

Suggested Modifications:
Add a smoothing average.

About the Author/Submitter:
EasyLanguage provided as an example only by TradeStation Technologies. No recommendation or endorsement of this idea should be implied.


 





Code to difficult? Find somebody to help you with coding here.

 


Source: https://www.tradestation.com

 

View similar (indicator for TradeStation):

Moving Average Spread Indicator
DBS-Break
Kaufman Smoothing Constant Part of the Graile
Trend Continuation Factor
DotDisp
Pivotal Trading
VIDYA/CDMA
Stochastic Momentum Indicator
Candle Code
Historical Volatility
...
 
 
all formulas for TradeStation
all formulas

 

 

Email to friend

Top

 

     
However we try to maintain hiqhest possible level of service - most formulas, oscillators, indicators
and systems are submitted by anonymous users.
Therefore S4T™ does not take any responsibility for it's quality.
If you use any of this information, use it at your own risk. You are responsible for your own trading decisions.
Be sure to verify that any information you see on these pages is correct, and is applicable to your particular trade.
In no case will S4T™ be responsible for your trading gains or losses.
PayPalSecure payments by PayPal S4T™ is a part of TAURO EDUCATION NETWORK
 
Privacy note | (c) copyrights systems4trading.com 2006-2009