Enhanced momentum confirmation
A 0 to 2 upside-momentum score: 1 when two or more look-back windows speed up, 2 when three do with a volume spike.
Scores each bar 0, 1 or 2 for upside momentum, with no sell side. It takes the percent change of the close over 1, 2, 3, 5 and 10 bars and counts the windows that are above the momentum threshold and rising faster than on the previous bar. Two or more such windows give a 1; three or more plus a volume spike, with the bar's volume above the 10-bar average times the volume ratio, give a 2.
How to read it
- The score sits in its own pane below the price on a 0, 1, 2 scale, and most bars read 0.
- A 1 means at least two look-back windows are speeding up; it needs no volume confirmation.
- A 2 means three or more windows are speeding up on heavy volume; it is the strong buy level.
- Read a 1 or 2 as momentum turning up, not as an entry on its own.
What it outputs
- Momentum score
- A buy score from 0 (no signal) to 2 (strong buy), built from momentum speed-up across five look-back windows and a volume check.
Settings
- momentum_threshold
- Minimum percent move a window must show, as a fraction (0.003 is 0.3 percent), before it can count. Raising it needs a bigger move and cuts the score; lowering it toward zero admits smaller moves, and below zero slightly falling windows can count too.
- acceleration_threshold
- How much a window's rate of change must rise over the previous bar's value (0.0005 is 0.05 points) to count as speeding up. Raising it needs sharper acceleration and cuts the score; at zero, any rise counts.
- volume_ratio
- How many times the bar's volume must exceed the 10-bar average, this bar included, to pass the volume check a 2 needs. Raising it makes a 2 rarer; at 1.0 the bar only needs to be above average. It does not affect a 1.
Pitfalls
- Rare at default settings: at least 95 percent of bars score 0 on one month of SPY one-minute data, so loosen the thresholds to see signals.
- The volume check counts the bar itself in its 10-bar average, so with the default 1.5 ratio the bar needs about 1.6 times the average of the prior nine bars.
- Code flag: look-ahead reads push extra copies of a bar into its histories, which can skew the speed-up and volume tests. Treat values read ahead of their bar as suspect.