Multi timeframe alignment detector
Marks bars where an up-move is accelerating: the last 5 minutes gained over 1.1 times the last 20 minutes.
Despite the name, this is not three timeframes: it reads one price series and measures the change in log price over the last 5, 20 and 50 one-minute bars. It scores four tests and marks a bar only when the total reaches 4 of 5 points, which requires the stepped-order test (worth 2 points): the 5-bar change must exceed 1.1 times the 20-bar change, and the 20-bar change must be at least about 95 percent of the 50-bar change. At default settings the only other requirement is a positive 50-bar change.
How to read it
- Markers sit on the candles only. There is no line or pane below the chart.
- A marker means the latest 5 minutes carried more than 1.1 times the 20-minute gain, and the 50-minute gain is up.
- No marker fires while the 50-minute change is negative, so at defaults it does not mark falls.
- Markers are rare at defaults: about 6 a day on SPY in September 2026, on under 1 percent of bars.
- Most marker runs last one bar (about 70 percent on the sample), so a lone marker is one fast minute.
What it outputs
- Accelerating rise
- A marker on each bar where the score reaches 4 of 5 points. It marks a rise that is speeding up into this bar. Nothing is drawn on other bars.
When it fires
On a bar where the latest 5 minutes gained more than 1.1 times the last 20 minutes' gain, the 20-minute gain was at least about 95 percent of the 50-minute gain, and the 50-minute gain is positive. The moment means a rise is speeding up into this bar, not that the rise will continue.
Settings
- short_window
- Bars in the latest-move test. Raising it to 10 adds about two-thirds more markers on the sample. Lowering it to 1 leaves about 2 a day. Keep it below medium_window: equal windows never mark at a threshold of 0 or more.
- medium_window
- Bars in the middle test: the 20-bar change must be at least about 95 percent of the 50-bar change. Lowering it to 10 adds about a quarter more markers. Raising it to 50, equal to long_window, drops that test for about four times as many.
- long_window
- Bars in the 50-bar change. It also sets the warm-up: one bar more than this passes before the first marker. Raising it to 100 cuts markers to about 3.7 a day on the sample. Lowering it to 30 lifts them to about 9.4.
- alignment_threshold
- The ratio the two ratio tests must beat. From 0 to 1 it changes nothing at default windows, since the stepped-order test already makes both ratios exceed 1. At 2 it cuts markers by about a quarter. Negative values mark falls: at -0.5, about 44 a day.
Pitfalls
- Not multi-timeframe. The 5, 20 and 50 bars are nested lookbacks on the same one-minute prices, so they move together and add little independent confirmation.
- Rare at defaults: about 0.9 percent of bars. The 1.1 and 1.05 ratios are fixed in code, so only the windows and threshold can be tuned.
- Inputs are unchecked. A negative alignment_threshold marks mostly falling prices, and a medium window above the long window silently acts as the long window.