Vdubus Divergence Wave Pattern Generator
fast_depth = 9 | slow_depth = 24 | fast_length = 21 | slow_length = 34 | signal_length = 5 | lookback = 3 | err_tol = 0.15 | show_standard = true | show_climax = true | show_rounded = true | show_predator = true | show_gartley = | show_bat = | show_butterfly = | show_crab = | show_deep = | show_hs = true Overview
Vdubus Divergence Wave Pattern Generator is a large multi-output pattern engine that combines MACD-style momentum, fast and slow divergence waves, and a configurable set of pattern filters. It is meant for traders who want one structured output set for momentum-wave interpretation rather than several separate indicators stitched together later.
In VectorTA the indicator runs on high-low-close input, supports many boolean feature toggles, streams live bars, and exposes broad batch sweeps across the depth, length, lookback, and tolerance controls. The result is best treated as a divergence and pattern panel, with fast and slow wave families plus MACD context and opposing-force output in one call.
Defaults: `fast_depth = 9`, `slow_depth = 24`, `fast_length = 21`, `slow_length = 34`, `signal_length = 5`, `lookback = 3`, `err_tol = 0.15`, with standard, climax, rounded, predator, and head-and-shoulders views enabled.
Implementation Examples
Run the generator on high-low-close slices or on candles with the default divergence-wave settings.
use vector_ta::indicators::vdubus_divergence_wave_pattern_generator::{
vdubus_divergence_wave_pattern_generator,
VdubusDivergenceWavePatternGeneratorInput,
VdubusDivergenceWavePatternGeneratorParams,
};
let output = vdubus_divergence_wave_pattern_generator(
&VdubusDivergenceWavePatternGeneratorInput::from_slices(
&high,
&low,
&close,
VdubusDivergenceWavePatternGeneratorParams::default(),
),
)?;
println!("fast standard = {:?}", output.fast_standard.last());
println!("opposing force = {:?}", output.opposing_force.last());
println!("hist = {:?}", output.hist.last());API Reference
Input Methods ▼
VdubusDivergenceWavePatternGeneratorInput::from_candles(&Candles, VdubusDivergenceWavePatternGeneratorParams)
-> VdubusDivergenceWavePatternGeneratorInput
VdubusDivergenceWavePatternGeneratorInput::from_slices(&[f64], &[f64], &[f64], VdubusDivergenceWavePatternGeneratorParams)
-> VdubusDivergenceWavePatternGeneratorInput
VdubusDivergenceWavePatternGeneratorInput::with_default_candles(&Candles)
-> VdubusDivergenceWavePatternGeneratorInputParameters Structure ▼
pub struct VdubusDivergenceWavePatternGeneratorParams {
pub fast_depth: Option<usize>,
pub slow_depth: Option<usize>,
pub fast_length: Option<usize>,
pub slow_length: Option<usize>,
pub signal_length: Option<usize>,
pub lookback: Option<usize>,
pub err_tol: Option<f64>,
pub show_standard: Option<bool>,
pub show_climax: Option<bool>,
pub show_rounded: Option<bool>,
pub show_predator: Option<bool>,
pub show_gartley: Option<bool>,
pub show_bat: Option<bool>,
pub show_butterfly: Option<bool>,
pub show_crab: Option<bool>,
pub show_deep: Option<bool>,
pub show_hs: Option<bool>,
}Output Structure ▼
pub struct VdubusDivergenceWavePatternGeneratorOutput {
pub fast_standard: Vec<f64>,
pub fast_climax: Vec<f64>,
pub fast_rounded: Vec<f64>,
pub fast_predator: Vec<f64>,
pub slow_standard: Vec<f64>,
pub slow_climax: Vec<f64>,
pub slow_rounded: Vec<f64>,
pub slow_predator: Vec<f64>,
pub opposing_force: Vec<f64>,
pub macd: Vec<f64>,
pub signal: Vec<f64>,
pub hist: Vec<f64>,
}Validation, Warmup & NaNs ▼
- High, low, and close slices must share the same non-zero length and contain enough usable data for the selected fast and slow depths.
- The resolved depth, MACD-style lengths, lookback, and error tolerance must all pass the Rust validator.
- Pattern toggles only filter which wave families are emitted; they do not bypass the core MACD and divergence warmup.
- Batch mode validates every numeric range before expanding the parameter grid.
Builder, Streaming & Batch APIs ▼
VdubusDivergenceWavePatternGeneratorBuilder::new()
.fast_depth(usize)
.slow_depth(usize)
.fast_length(usize)
.slow_length(usize)
.signal_length(usize)
.lookback(usize)
.err_tol(f64)
.show_standard(bool)
.show_climax(bool)
.show_rounded(bool)
.show_predator(bool)
.show_gartley(bool)
.show_bat(bool)
.show_butterfly(bool)
.show_crab(bool)
.show_deep(bool)
.show_hs(bool)
.apply_slices(&[f64], &[f64], &[f64])
VdubusDivergenceWavePatternGeneratorStream::try_new(params)
stream.update(high, low, close)
VdubusDivergenceWavePatternGeneratorBatchBuilder::new()
.fast_depth_range(start, end, step)
.slow_depth_range(start, end, step)
.fast_length_range(start, end, step)
.slow_length_range(start, end, step)
.signal_length_range(start, end, step)
.lookback_range(start, end, step)
.err_tol_range(start, end, step)
.apply_slices(&[f64], &[f64], &[f64])Python Bindings
Python exposes a dictionary-returning function, a stream class, and a batch helper for the divergence-wave matrix.
from vector_ta import (
vdubus_divergence_wave_pattern_generator,
vdubus_divergence_wave_pattern_generator_batch,
VdubusDivergenceWavePatternGeneratorStream,
)
single = vdubus_divergence_wave_pattern_generator(high, low, close)
stream = VdubusDivergenceWavePatternGeneratorStream()
row = stream.update(high[-1], low[-1], close[-1])
batch = vdubus_divergence_wave_pattern_generator_batch(
high,
low,
close,
fast_depth_range=(7, 11, 2),
slow_depth_range=(20, 28, 4),
fast_length_range=(13, 21, 4),
slow_length_range=(26, 34, 4),
signal_length_range=(3, 7, 2),
lookback_range=(2, 4, 1),
err_tol_range=(0.10, 0.20, 0.05),
)JavaScript/WASM Bindings
The WASM layer exposes direct, batch, allocation, and into-buffer helpers for divergence-wave workloads.
import init, {
vdubus_divergence_wave_pattern_generator_js,
vdubus_divergence_wave_pattern_generator_batch,
vdubus_divergence_wave_pattern_generator_batch_unified_js,
} from "vector-ta-wasm";
await init();
const single = vdubus_divergence_wave_pattern_generator_js(high, low, close);
const batch = vdubus_divergence_wave_pattern_generator_batch_unified_js(high, low, close, {
fast_depth_range: [7, 11, 2],
slow_depth_range: [20, 28, 4],
fast_length_range: [13, 21, 4],
slow_length_range: [26, 34, 4],
signal_length_range: [3, 7, 2],
lookback_range: [2, 4, 1],
err_tol_range: [0.10, 0.20, 0.05],
});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)