Skip to content

Volume Breakout

Nalin Angrish edited this page Jul 18, 2026 · 1 revision

Volume Breakout

Overview

The Volume Breakout indicator detects anomalous spikes in trading volume by comparing the most recent volume observation against a trailing simple moving average (SMA). When current volume exceeds the SMA by a configurable threshold, it signals institutional or algorithmic interest — a necessary condition before any trade intent is published.

In Navier-Stocks, volume confirmation is the gatekeeper that prevents false breakouts: no signal leaves the Quantitative Scout unless the volume surge condition is satisfied.

Mathematical Definition

Given a sequence of volume observations $v_1, v_2, \dots, v_m$ where $v_m$ is the current (most recent) value:

The volume SMA is the arithmetic mean of the preceding $\text{window}$ observations:

$$ \text{VolumeSMA} = \begin{cases} \frac{1}{w} \displaystyle\sum_{j=m-w}^{m-1} v_j, & m-1 \ge w \[1.2em] \frac{1}{m-1} \displaystyle\sum_{j=1}^{m-1} v_j, & m-1 < w \end{cases} $$

Where $w = \text{window}$ and $m-1$ is the number of available prior observations.

The breakout ratio:

$$ R = \frac{v_m}{\text{VolumeSMA}} $$

A breakout is declared when:

$$ R \ge \text{threshold} $$

The standard configuration uses:

  • $\text{window} = 10$ (rolling 10-period average)
  • $\text{threshold} = 2.0$ (current volume must be at least double the average)

Interpretation

Ratio Meaning
$R &lt; 1.0$ Current volume below average — normal or declining interest
$1.0 \le R &lt; 2.0$ Above-average volume but not yet anomalous
$R \ge 2.0$ Breakout — statistically significant volume spike

Role in the Pipeline

TickStore.RecentVolumes(n)
         │
         ▼
  VolumeBreakout(volumes, window=10, threshold=2.0)
         │
         ├──► IsBreakout = true  ──► Proceed to VWAP/Bollinger check
         └──► IsBreakout = false ──► Discard signal

Volume breakout is evaluated in conjunction with VWAP crossover and Bollinger Band position:

[Volume Breakout]  AND  ([VWAP Crossover]  OR  [Bollinger Break])
                              │                        │
                              ▼                        ▼
                       signal.intent.LONG        signal.intent.SHORT

Implementation

File: src/analysts/quantitative/indicators/volume.go

Function Input Returns
VolumeBreakout volumes []int64, window int, threshold float64 VolumeResult{IsBreakout, CurrentVolume, VolumeSMA, Ratio, Window}

Underlying math primitives: src/pkg/math/math.go — Mean()

Constants

const DefaultVolumeWindow   = 10
const DefaultVolumeThreshold = 2.0

Algorithm Steps

  1. Validate inputs: require at least 2 total volumes, window >= 1, threshold > 0.
  2. Extract the last element as the current volume.
  3. Take up to window prior values as the baseline.
  4. Compute the arithmetic mean of the baseline.
  5. If mean is zero, return Ratio = 0 (cannot evaluate).
  6. Compute ratio = current / sma.
  7. Declare breakout when ratio >= threshold.

Edge Cases

Condition Behaviour
len(volumes) < 2 IsBreakout = false (no prior for comparison)
window < 1 IsBreakout = false
threshold <= 0 IsBreakout = false
All prior volumes zero IsBreakout = false, Ratio = 0
Fewer prior values than window Uses all available prior values
Single-element input IsBreakout = false
Current exactly at threshold IsBreakout = true (inclusive check)

Example

Prior volumes: [100, 110, 90, 105, 95]
Current volume: 200
Window: 5
Threshold: 2.0

VolumeSMA = (100 + 110 + 90 + 105 + 95) / 5 = 100
Ratio = 200 / 100 = 2.0
IsBreakout = true  (2.0 >= 2.0)

References

  • VWAP Indicator — primary trend anchor used alongside volume confirmation
  • Bollinger Bands Indicator — complementary volatility filter
  • src/analysts/quantitative/indicators/volume_test.go — comprehensive test suite
  • wiki/Risk-Guardrails.md — strategy description (section 4, The Alpha Trigger Module)

🌊 Navier-Stocks Documentation


Clone this wiki locally