Repository navigation
Volume Breakout
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.
Given a sequence of volume observations
The volume SMA is the arithmetic mean of the preceding
Where
The breakout ratio:
A breakout is declared when:
The standard configuration uses:
-
$\text{window} = 10$ (rolling 10-period average) -
$\text{threshold} = 2.0$ (current volume must be at least double the average)
| Ratio | Meaning |
|---|---|
| Current volume below average — normal or declining interest | |
| Above-average volume but not yet anomalous | |
| Breakout — statistically significant volume spike |
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
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()
const DefaultVolumeWindow = 10
const DefaultVolumeThreshold = 2.0- Validate inputs: require at least 2 total volumes,
window >= 1,threshold > 0. - Extract the last element as the current volume.
- Take up to
windowprior values as the baseline. - Compute the arithmetic mean of the baseline.
- If mean is zero, return
Ratio = 0(cannot evaluate). - Compute
ratio = current / sma. - Declare breakout when
ratio >= threshold.
| 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) |
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)
- 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)
- Home
- Core Architecture
- Indicator Reference
-
Developer Sandbox
- Local Environment & Quickstart (Pending)
- Testing & Backtesting Strategy (Pending)
-
Operational Systems
- Infrastructure Runbook & Recovery (Pending)