Volume Weighted Average Price (VWAP)
The Volume Weighted Average Price is a Volume weighted average of price, typically used on intraday data. [Discuss] 💬
// C# usage syntax
IEnumerable<VwapResult> results =
quotes.GetVwap();
// usage with optional anchored start date
IEnumerable<VwapResult> results =
quotes.GetVwap(startDate);
Parameters
startDate
DateTime
- Optional. The anchor date used to start the VWAP accumulation. The earliest date in quotes
is used when not provided.
Historical quotes requirements
You must have at least one historical quote to calculate; however, more is often needed to be useful. Historical quotes are typically provided for a single day using minute-based intraday periods. Since this is an accumulated weighted average price, different start dates will produce different results. The accumulation starts at the first period in the provided quotes
, unless it is specified in the optional startDate
parameter.
quotes
is a collection of generic TQuote
historical price quotes. It should have a consistent frequency (day, hour, minute, etc). See the Guide for more information.
Response
IEnumerable<VwapResult>
- This method returns a time series of all available indicator values for the
quotes
provided. - It always returns the same number of elements as there are in the historical quotes.
- It does not return a single incremental indicator value.
- The first period or the
startDate
will have aVwap = Close
value since it is the initial starting point. Vwap
values beforestartDate
, if specified, will benull
.
VwapResult
Date
DateTime
- Date from evaluated TQuote
Vwap
double
- Volume Weighted Average Price
Utilities
See Utilities and helpers for more information.
Chaining
Results can be further processed on Vwap
with additional chain-enabled indicators.
// example
var results = quotes
.GetVwap(..)
.GetRsi(..);
This indicator must be generated from quotes
and cannot be generated from results of another chain-enabled indicator or method.