Trend Persistence Counter (TPC) by riskcipher🧭 Trend Persistence Counter (TPC) – A Simple Price Action Trend Duration Tool
Trend Persistence Counter (TPC) is a lightweight indicator that counts how long a trend persists after a breakout.
It is entirely based on price action, without using any moving averages or smoothing. The goal is to give a simple, rule-based view of trend continuity.
🧠 How It Works (Logic Overview)
This indicator switches between two modes: bullish and bearish.
If close > previous high, the counter enters bullish mode, and starts at +1
While in bullish mode:
If close >= previous low → continue the uptrend → +1 each bar
If close < previous low → trend ends → reset to 0, switch to bearish mode
If close < previous low, the counter enters bearish mode, and starts at -1
While in bearish mode:
If close <= previous high → continue the downtrend → -1 each bar
If close > previous high → trend ends → reset to 0, switch to bullish mode
This provides a bar-by-bar count of trend persistence based on whether price holds structure.
🎯 Use Cases
Track how long a trend continues after a breakout
Quickly detect when trend structure breaks
Help visually filter “strong” vs “weak” moves
Build logic-based alerts (e.g., trend continues for N bars)
🔍 Why Use This Instead of Traditional Indicators?
This is not meant to replace moving averages or trend filters.
But it offers some advantages for those who prefer structure-based logic:
Feature TPC
Based on Price Action ✅ Yes
Uses Lagging Filters ❌ No moving average or smoothing
Trend Duration Measurement ✅ Counts valid consecutive moves
Complexity ⚪ Very simple and transparent
It’s a simple concept and easy to understand, but still useful when combined with other tools or visualized on its own.
⚙️ Technical Notes
Works on any timeframe or instrument
The value is positive during bullish persistence, negative during bearish
Value resets to 0 when trend structure breaks
All logic is calculated bar-by-bar, in real time
✅ Example Usage Ideas
Highlight candles when TPC value crosses a certain threshold (e.g., strong breakout continuation)
Use the zero-cross as a potential reversal warning
Filter trend signals in your existing strategies
Trendstructure
New Momentum H/LNew Momentum H/L shows when momentum, defined as the rate of price change over time, exceeds the highest or lowest values observed over a user-defined period. These events shows points where momentum reaches new extremes relative to that period, and the indicator plots a column to mark each occurrence.
Increase in momentum could indicate the start of a trend phase from a low volatile or balanced state. However in developed trends, extreme momentum could also mark potential climaxes which can lead to trend termination. This reflects the dual nature of the component.
This indicator is based on the MACD calculated as the difference between a 3-period and a 10-period simple moving average. New highs are indicated when this value exceeds all previous values within the lookback window; new lows when it drops below all previous values. The default lookback period is set to 40 bars, which corresponds with two months on a daily chart.
The indicator also computes a z-score of the MACD line over the past 100 bars. This standardization helps compare momentum across different periods and normalizes the values of current moves relative to recent history.
In practice, use the indicator to confirm presence of momentum at the start of a move from a balanced state (often following a volatility expansion), track how momentum develops inside of a trend structure and locate potential climactic events.
Momentum should in preference be interpreted from price movement. However, to measure and standardize provides structure and helps build more consistent models. This should be used in context of price structure and broader market conditions; as all other tools.