Exponential trend detector
Marks bars where the latest one-minute move is much stronger than the move before it, a short-term up-turn.
ExponentialTrendDetector looks at the last three closes. It takes the latest one-minute change minus the change before it, divides by the latest close, and marks the bar when that exceeds the threshold. Despite the name, it fits no exponential curve; it flags a sharp one-bar turn up, not a sustained trend.
How to read it
- Markers sit on the candles where the latest close pulled up harder than the close before it.
- One marker means one bar turned up sharply. A cluster of markers means repeated up-turns, not a confirmed trend.
- Markers also appear inside downtrends: a small drop after a big drop counts as upward acceleration.
What it outputs
- Upward acceleration
- Marks each bar whose latest one-minute move beats the previous move by more than the threshold. The stored value is that gap divided by the close.
When it fires
Fires on a bar whose latest one-minute change exceeds the previous change by more than threshold times the close. At default on SPY near 765 that gap is about 8 cents. It means the price is turning up or slowing its fall at the one-bar scale, not that a trend is confirmed.
Settings
- lookback
- Sets how many bars must build before the first marker, and nothing else: the calculation reads only the last three closes. Raising it delays the first marker. Values 1 and 2 never fire.
- acceleration_threshold
- The minimum gap between the latest move and the previous move, as a share of price. At 0.0001 on SPY near 765 that is about 8 cents. Raising it keeps only sharper up-turns; lowering it adds weaker ones, and below zero also marks slightly negative gaps.
Pitfalls
- The name says exponential, but nothing is fitted. A slope term is computed and never used, and lookback only sets the warm-up.
- It flags turns, not trends. It fires on about 28% of bars in the September SPY sample, roughly 228 a day, so the chart gets dense.
- Lookback 1 or 2 never fires, because the history never holds the three closes the calculation needs.