On-Balance Volume (OBV)
Popularized by Joseph Granville, On-balance Volume is a rolling accumulation of volume based on Close price direction. [Discuss] 💬
// usage IEnumerable<ObvResult> results = quotes.GetObv(); // usage with optional overlay SMA of OBV (shown above) IEnumerable<ObvResult> results = quotes.GetObv(smaPeriods);
int - Optional. Number of periods (
N) in the moving average of OBV. Must be greater than 0, if specified.
Historical quotes requirements
You must have at least two historical quotes to cover the warmup periods; however, since this is a trendline, more is recommended.
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.
- This method returns a time series of all available indicator values for the
- 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 OBV will have
0value since there’s not enough data to calculate.
DateTime - Date from evaluated
double - On-balance Volume
double - Moving average (SMA) of OBV based on
smaPeriods periods, if specified
🚩 Warning: absolute values in OBV are somewhat meaningless. Use with caution.
See Utilities and helpers for more information.
Results can be further processed on
Obv with additional chain-enabled indicators.
// example var results = quotes .GetObv(..) .GetRsi(..);
This indicator must be generated from
quotes and cannot be generated from results of another chain-enabled indicator or method.