Pivot Points (PIVOT)

Parameters: mode = 3

Overview

Pivot Points calculate a central reference level and surrounding support resistance bands from the previous period's high, low, and close prices, providing floor traders and technical analysts with objective levels where price action may pause or reverse. The standard formula averages the high, low, and close to establish the pivot point, then generates support levels below and resistance levels above using arithmetic progressions based on the range. Different calculation methods like Fibonacci apply specific ratios to adjust the spacing between levels, Demark focuses on the relationship between close and open to calculate conditional pivots, Camarilla emphasizes tighter bands with a multiplier approach for intraday trading, and Woodie gives extra weight to the current close. Traders use these levels as decision points for entries, exits, and stop placement, with price holding above the pivot typically indicating bullish conditions and falling below suggesting bearish pressure. The multiple support and resistance bands provide layered targets for profit taking and zones to watch for reversals, making pivot points especially popular among day traders who need predefined reference levels before the market opens.

Defaults: Camarilla mode (mode = 3). Other modes available: Standard (0), Fibonacci (1), Demark (2), Woodie (4).

Implementation Examples

use vectorta::indicators::pivot::{pivot, PivotInput, PivotParams};
use vectorta::utilities::data_loader::read_candles_from_csv;
let (high, low, close, open) = (vec![], vec![], vec![], vec![]);
let input = PivotInput::from_slices(&high, &low, &close, &open, PivotParams { mode: Some(3) });
let out = pivot(&input)?;

API Reference

Input Methods
PivotInput::from_slices(&[f64], &[f64], &[f64], &[f64], PivotParams)
PivotInput::from_candles(&Candles, PivotParams)
PivotInput::with_default_candles(&Candles)
Parameters Structure
pub struct PivotParams { pub mode: Option<usize> } // Default: Some(3)
Output Structure
pub struct PivotOutput { r4: Vec<f64>, r3: Vec<f64>, r2: Vec<f64>, r1: Vec<f64>, pp: Vec<f64>, s1: Vec<f64>, s2: Vec<f64>, s3: Vec<f64>, s4: Vec<f64> }
Validation, Warmup & NaNs
  • Lengths must match; empty input or mismatched lengths yield PivotError::EmptyData.
  • Warmup NaNs through the first index where H/L/C are valid; per-index NaNs propagate.
  • AllValuesNaN when no valid H/L/C; NotEnoughValidData when first valid index ≥ len.
Error Handling
enum PivotError { EmptyData, AllValuesNaN, NotEnoughValidData }

Python Bindings

Quick Start
import numpy as np
from vectorta import pivot, PivotStream, pivot_batch

high = np.array([/* ... */], dtype=np.float64)
low  = np.array([/* ... */], dtype=np.float64)
close= np.array([/* ... */], dtype=np.float64)
open_ = np.array([/* ... */], dtype=np.float64)

# One-shot
result = pivot(high, low, close, open_, mode=3)  # tuple of 9 arrays

# Streaming
stream = PivotStream(mode=3)
levels = stream.update(h, l, c, o)  # (r4,r3,r2,r1,pp,s1,s2,s3,s4) or None

# Batch sweep across modes
res = pivot_batch(high, low, close, open_, mode_range=(0, 4, 1), kernel='auto')
# res contains keys: 'r4','r3','r2','r1','pp','s1','s2','s3','s4', with shape (num_modes, len)

CUDA Acceleration

CUDA support for Pivot Points is coming soon.

JavaScript/WASM Bindings

Available: pivot_js, pivot_into, pivot_alloc/free, and pivot_batch (WASM).

Performance Analysis

Comparison:
View:
Loading chart...

AMD Ryzen 9 9950X (CPU) | NVIDIA RTX 4090 (GPU) | Benchmarks: 2026-01-05

Related Indicators