OPEN-SOURCE SCRIPT
Trend Pulse Oscillator [invincible3]

Trend Pulse Oscillator (TPO) is a hybrid trend + momentum indicator that combines normalized squeeze momentum with normalized MACD confirmation in a single oscillator.
The indicator helps traders analyze three key market conditions:
Unlike traditional indicators that operate on different scales, TPO normalizes all components into the same range, making it easier to visually compare signals in one panel.
⚙️ How It Works
The indicator combines two main analytical components.
🔹 Squeeze Momentum Engine
A Bollinger Band vs Keltner Channel squeeze framework is used to detect periods of volatility compression.
When volatility compresses, markets often prepare for a strong directional move.
A linear regression momentum calculation is applied and then normalized using statistical scaling, producing the histogram that represents the trend pulse.
🔹 Normalized MACD Confirmation
The indicator also calculates MACD and Signal lines, but instead of plotting the raw values, both lines are normalized to match the oscillator scale.
This allows traders to easily compare:
• trend confirmation
• momentum acceleration
• direction changes
within the same visual space.
📊 Visual Elements
Histogram – Trend Pulse
The histogram represents the main momentum engine.
• Rising green bars → strengthening bullish momentum
• Falling red bars → strengthening bearish momentum
• Above zero → bullish bias
• Below zero → bearish bias
🔵 MACD & 🟠 Signal Lines
• Blue line → normalized MACD
• Orange line → normalized Signal
MACD above Signal suggests bullish confirmation.
MACD below Signal suggests bearish confirmation.
🎯 Zero Line (Volatility State)
The zero line changes color to display squeeze conditions.
Yellow → squeeze active (volatility compression)
Gray → squeeze released (volatility expansion)
Blue → neutral state
This helps traders identify potential breakout environments.
📏 Reference Bands
Upper and lower bands highlight extended momentum zones, which may indicate:
• strong trend continuation
• possible momentum exhaustion
• overextended market conditions
⚙️ Settings
Squeeze Settings
Controls volatility compression detection.
• BB Length
• BB MultFactor
• KC Length
• KC MultFactor
• Use True Range
📐 Normalization Settings
Controls statistical scaling of the oscillator.
• Normalize Lookback
• Target Range
• Z-Score Clamp
• Band Level
These parameters adjust how values are scaled and displayed visually.
📈 MACD Settings
Controls the trend confirmation component.
• Fast Length
• Slow Length
• Signal Length
• EMA or SMA options
💡 Typical Usage
Traders often look for alignment between:
✅ Rising histogram momentum
✅ MACD above Signal
✅ Squeeze release after compression
This combination may indicate momentum expansion within a developing trend.
Similarly:
Falling histogram
MACD below Signal
can suggest bearish momentum continuation.
⭐ Key Features
✔ Combines volatility, momentum, and trend confirmation
✔ Uses statistical normalization for cleaner visualization
✔ Helps identify momentum expansion phases
✔ Works across all markets and timeframes
⚠️ Notes
• Designed as a trend and momentum analysis tool
• Normalization is used for visual comparison only
• Best used alongside price action, support/resistance, or higher timeframe analysis
The indicator helps traders analyze three key market conditions:
- Trend direction
- Momentum strength
- Volatility compression and expansion
Unlike traditional indicators that operate on different scales, TPO normalizes all components into the same range, making it easier to visually compare signals in one panel.
⚙️ How It Works
The indicator combines two main analytical components.
🔹 Squeeze Momentum Engine
A Bollinger Band vs Keltner Channel squeeze framework is used to detect periods of volatility compression.
When volatility compresses, markets often prepare for a strong directional move.
A linear regression momentum calculation is applied and then normalized using statistical scaling, producing the histogram that represents the trend pulse.
🔹 Normalized MACD Confirmation
The indicator also calculates MACD and Signal lines, but instead of plotting the raw values, both lines are normalized to match the oscillator scale.
This allows traders to easily compare:
• trend confirmation
• momentum acceleration
• direction changes
within the same visual space.
📊 Visual Elements
Histogram – Trend Pulse
The histogram represents the main momentum engine.
• Rising green bars → strengthening bullish momentum
• Falling red bars → strengthening bearish momentum
• Above zero → bullish bias
• Below zero → bearish bias
🔵 MACD & 🟠 Signal Lines
• Blue line → normalized MACD
• Orange line → normalized Signal
MACD above Signal suggests bullish confirmation.
MACD below Signal suggests bearish confirmation.
🎯 Zero Line (Volatility State)
The zero line changes color to display squeeze conditions.
Yellow → squeeze active (volatility compression)
Gray → squeeze released (volatility expansion)
Blue → neutral state
This helps traders identify potential breakout environments.
📏 Reference Bands
Upper and lower bands highlight extended momentum zones, which may indicate:
• strong trend continuation
• possible momentum exhaustion
• overextended market conditions
⚙️ Settings
Squeeze Settings
Controls volatility compression detection.
• BB Length
• BB MultFactor
• KC Length
• KC MultFactor
• Use True Range
📐 Normalization Settings
Controls statistical scaling of the oscillator.
• Normalize Lookback
• Target Range
• Z-Score Clamp
• Band Level
These parameters adjust how values are scaled and displayed visually.
📈 MACD Settings
Controls the trend confirmation component.
• Fast Length
• Slow Length
• Signal Length
• EMA or SMA options
💡 Typical Usage
Traders often look for alignment between:
✅ Rising histogram momentum
✅ MACD above Signal
✅ Squeeze release after compression
This combination may indicate momentum expansion within a developing trend.
Similarly:
Falling histogram
MACD below Signal
can suggest bearish momentum continuation.
⭐ Key Features
✔ Combines volatility, momentum, and trend confirmation
✔ Uses statistical normalization for cleaner visualization
✔ Helps identify momentum expansion phases
✔ Works across all markets and timeframes
⚠️ Notes
• Designed as a trend and momentum analysis tool
• Normalization is used for visual comparison only
• Best used alongside price action, support/resistance, or higher timeframe analysis
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.