MetaStock™ Zone Tworzenie Sytemów Trader Shop Forum & FAQ Artykuły Linki Elliott Waves EasyLanguage™ Zone

 

Volume Weighted Average Price

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.

Source / From: TOP
https://www.tradestation.com

Equis and MetaStock® and MetaStock Professional® are registered trademarks of Equis International. Achelis Binary Wave®, The DownLoader®,
Expert Advisor®, OptionScope®, Quotecenter® and Smart Charts® are trademarks of Equis International, a Thomson Reuters company.

TradeStation® Pro, TradeStation® 2000i, OptionStation®, SuperCharts®, PowerEditor® and EasyLanguage®
are registered trademarks of TradeStation Technologies, Inc. Other names and marks referred to are the property of their respective owners.

All information provided on this website is for educational purposes only. Trading involves risk, including possible loss of principal and other losses.

Ten i inne materiały na tej stronie zostały zamieszczone zostały jedynie w celach edukacyjnych, nie ponoszę żadnej odpowiedzialno¶ci za ich stosowanie.

Gra na giełdzie niesie ze sob± ryzyko poważnych strat finansowych!