Volume Weighted RSI
period = Overview
Volume Weighted RSI takes the familiar RSI idea and reweights it with volume participation, producing a single oscillator line that responds differently when price movement is backed by heavier or lighter trading activity.
In VectorTA the indicator accepts close-plus-volume slices or candles with an explicit close field, supports streaming updates, and exposes a single-axis batch sweep over the RSI period. It is a straightforward replacement when you want a volume-aware oscillator but do not need a larger panel of companion outputs.
Defaults: `period = 14`.
Implementation Examples
Run the indicator on close-plus-volume slices or on candle data using the default close source.
use vector_ta::indicators::volume_weighted_rsi::{
volume_weighted_rsi,
VolumeWeightedRsiInput,
VolumeWeightedRsiParams,
};
let output = volume_weighted_rsi(&VolumeWeightedRsiInput::from_slices(
&close,
&volume,
VolumeWeightedRsiParams { period: Some(14) },
))?;
println!("vw-rsi = {:?}", output.values.last());API Reference
Input Methods ▼
VolumeWeightedRsiInput::from_candles(&Candles, "close", VolumeWeightedRsiParams)
-> VolumeWeightedRsiInput
VolumeWeightedRsiInput::from_slices(&[f64], &[f64], VolumeWeightedRsiParams)
-> VolumeWeightedRsiInput
VolumeWeightedRsiInput::with_default_candles(&Candles)
-> VolumeWeightedRsiInputParameters Structure ▼
pub struct VolumeWeightedRsiParams {
pub period: Option<usize>,
}Output Structure ▼
pub struct VolumeWeightedRsiOutput {
pub values: Vec<f64>,
}Validation, Warmup & NaNs ▼
- Close and volume inputs must share the same non-zero length and contain enough valid values for the resolved
period. - The default candle helper uses the
closefield, while the explicit candle path accepts a chosen close source. - Streaming returns
Noneuntil the RSI state is warmed up and also exposes a reset path. - Batch mode validates the period range before generating the matrix.
Builder, Streaming & Batch APIs ▼
VolumeWeightedRsiBuilder::new()
.period(usize)
.kernel(Kernel)
.apply(&Candles, "close")
.apply_slices(&[f64], &[f64])
.into_stream()
VolumeWeightedRsiStream::try_new(params)
stream.update(close, volume) -> Option<f64>
stream.reset()
VolumeWeightedRsiBatchBuilder::new()
.period_range(start, end, step)
.apply_slices(&[f64], &[f64])Python Bindings
Python exposes direct, stream, and batch helpers for the single VW-RSI oscillator line.
from vector_ta import volume_weighted_rsi, volume_weighted_rsi_batch, VolumeWeightedRsiStream
single = volume_weighted_rsi(close, volume, period=14)
stream = VolumeWeightedRsiStream(period=14)
point = stream.update(close[-1], volume[-1])
batch = volume_weighted_rsi_batch(close, volume, period_range=(7, 21, 7))JavaScript/WASM Bindings
The WASM layer exposes direct, batch, allocation, and into-buffer helpers for VW-RSI calculations.
import init, { volume_weighted_rsi_js, volume_weighted_rsi_batch_js } from "vector-ta-wasm";
await init();
const single = volume_weighted_rsi_js(close, volume, 14);
const batch = volume_weighted_rsi_batch_js(close, volume, { period_range: [7, 21, 7] });CUDA Bindings (Rust)
Additional details for the CUDA bindings can be found inside the VectorTA repository.
Performance Analysis
Across sizes, Rust CPU runs about 1.14× faster than Tulip C in this benchmark.
AMD Ryzen 9 9950X (CPU) | NVIDIA RTX 4090 (GPU)
Related Indicators
Accumulation/Distribution
Technical analysis indicator
Accumulation/Distribution Oscillator
Technical analysis indicator
Balance of Power
Technical analysis indicator
Chaikin Flow Oscillator
Technical analysis indicator
Elder Force Index
Technical analysis indicator
Ease of Movement
Technical analysis indicator