Momentum acceleration detector
Marks bars where the one-minute return improves on the bar before by more than its recent average change.
It reads closes only. Each bar's one-minute return is compared with the previous bar's return, and that change is what the code calls momentum. A bar is marked when its momentum is positive and larger than the window's average momentum times the factor. That average equals the net change in one-minute return across the window divided by its length, so in practice the test is mostly 'this bar's return beat the one before'.
How to read it
- Markers sit on the candles where the test passes. On the SPY sample at defaults that was about 43% of bars, so read clusters rather than single markers.
- A marker means this minute's return improved on the last minute's. A bar that falls less than the bar before can also qualify, so a marker does not mean price is rising.
- Runs of markers through a move mean the one-minute return keeps improving; scattered single markers are mostly noise at default settings.
What it outputs
- Acceleration marker
- True on bars where the one-minute return beats the bar before by more than the factor times the window's average change. Nothing is drawn on other bars.
When it fires
On a bar whose one-minute return beats the bar before by more than the factor times the window's average change. It means a short-term improvement in the return, not a confirmed trend turn, and it can also fire when a fall slows.
Settings
- window_short
- Bars in the baseline. Short windows (2 or 3) compare the latest step with one or two recent steps. At 1, a factor of 1 or more means it never fires. Longer windows shrink the baseline toward zero, so markers spread to more bars.
- window_long
- Only sets the warm-up: markers start after about this many bars of history. The calculation never reads it again, so raising it changes nothing after the first markers.
- acceleration_factor
- How many times the window's average momentum the latest step must beat. Raising it thins markers, but gradually. Above window_short the rule flips and fires on small up-steps after a net drop. Negative values fire on most up-steps.
Pitfalls
- On SPY one-minute bars with defaults it was on for about 43% of bars and started about 300 separate runs a day, so a marker alone is not a signal. Pair it with a trend or level filter.
- It measures a change in return, not price direction. A falling bar that falls less than the one before can also mark, so a falling market can show many markers.
- window_long does not shape the signal. The code stores returns but reads only their count, so the parameter only delays the first marker.