ITCHCPP 1.6.0
High-Performance NASDAQ TotalView-ITCH 5.0 Parser & Market-Data Platform
Loading...
Searching...
No Matches
itch::analytics::Vwap Class Reference

Running volume-weighted average price. More...

#include <vwap.hpp>

Public Member Functions

auto add (StandardPrice price, std::uint64_t shares) -> void
 Adds an execution of shares at price to the accumulation.
 
auto value () const -> double
 The current VWAP, or NaN when no volume has been added.
 
auto volume () const noexcept -> std::uint64_t
 The total shares accumulated so far.
 
auto reset () noexcept -> void
 Clears the accumulation (start a new interval).
 

Detailed Description

Running volume-weighted average price.

Accumulates the sum of price times shares and the total shares; the value is their ratio. Use reset at the start of each interval for an interval VWAP.

Definition at line 23 of file vwap.hpp.

Member Function Documentation

◆ add()

auto itch::analytics::Vwap::add ( StandardPrice  price,
std::uint64_t  shares 
) -> void
inline

Adds an execution of shares at price to the accumulation.

Parameters
priceExecution price of the trade being added.
sharesNumber of shares traded at price.

Definition at line 29 of file vwap.hpp.

References price, and shares.

◆ value()

auto itch::analytics::Vwap::value ( ) const -> double
inline

The current VWAP, or NaN when no volume has been added.

Returns
The volume-weighted average price, or NaN if volume() is zero.

Definition at line 37 of file vwap.hpp.

◆ volume()

auto itch::analytics::Vwap::volume ( ) const -> std::uint64_t
inlinenoexcept

The total shares accumulated so far.

Returns
The sum of shares passed to add since construction or the last reset.

Definition at line 47 of file vwap.hpp.

◆ reset()

auto itch::analytics::Vwap::reset ( ) -> void
inlinenoexcept

Clears the accumulation (start a new interval).

Definition at line 50 of file vwap.hpp.


The documentation for this class was generated from the following file: