Momentum surge
Signed score of recent price acceleration against the longer trend, weighted by current volume; zero is flat.
It takes the percent move over the last few bars (four at the default fast_period of 5) and subtracts a share of the percent move over slow_period bars (20 by default), where the share is fast_period divided by slow_period. That gap is multiplied by the current bar's volume divided by the average volume over vol_period bars, so heavy-volume bars enlarge the reading and a bar with no volume reads zero. The output is one signed number with no fixed range.
How to read it
- The score sits in its own pane below the price, centred on zero, with no fixed top or bottom.
- Positive means the last few bars moved more than the longer pace implies; negative means less. A steady rise reads below zero (0.1% a bar reads about -0.1), so read turns and spikes rather than the sign during a trend.
- Most bars sit between about -0.06 and +0.07. Readings near +3 or -4, the sample's extremes, are rare bursts worth checking against the candles.
- Flat stretches and zero-volume bars draw zero, and the first slow_period bars stay blank while the windows fill.
What it outputs
- Surge score
- Short-term move minus its pro-rated longer move, times current volume against its recent average. Zero is flat or no volume; no fixed range.
Settings
- fast_period
- Bars in the short-term move. Higher values make the reading slower and smoother; lower values react to single bars. Keep it at or below slow_period + 1, or the Python path reads past its price buffer and raises an error.
- slow_period
- Length of the longer move the short move is measured against, and the number of bars before the first reading. Higher values compare against a slower trend and need more warm-up; lower values react to shorter swings.
- vol_period
- Bars averaged to set the volume baseline. Longer averages judge each bar against more history; shorter ones follow recent volume closely. At 1 every bar's volume factor is 1, so volume drops out.
Pitfalls
- The short move covers fast_period minus one bars, but the baseline is pro-rated by fast_period, so a steady trend reads the wrong way.
- Zero is common: a flat window or a bar with no volume reads exactly 0, and the sample median is 0, so quiet minutes look like nothing is happening.
- A few large spikes (up to +3 and -4 in the sample) stretch the pane and squeeze ordinary readings near zero, so the scale can hide normal moves.