OPEN-SOURCE SCRIPT
Trend Energy Filter

🚀 Trend Energy Filter
Introducing a new dimension in trend analysis: Trend Energy.
In automotive systems (like ECU sensor data), we use hysteresis and noise-gates to prevent "jitter" from triggering false responses.
This script applies that same logic to Momentum (Trend Energy):
- ENERGY: Measures the "Engine Load" of the trend by calculating the distance from a long-term SMA.
- NOISE FILTER: Uses an ATR-based threshold. The Energy value only updates if the change is significant, effectively filtering out the "market static" that causes false signals.
- EXHAUSTION: Detects when the "Fuel" is running out by identifying peaks in energy and subsequent cooling.
While this type of signal processing is often hidden inside expensive commercial "black box" tools, this script provides it as a transparent, open-source engineering solution.
While standard indicators look at price in isolation, the Trend Energy Filter analyzes the "tension" between price and its long-term baseline (SMA). By focusing on the Surface Area of this tension, we gain a visual representation of market conviction that has been largely overlooked by traditional technical analysis.
The Innovation of the "Energy Surface"
Most traders view moving averages as simple static lines. The Trend Energy Filter reimagines the gap between price and the SMA as a dynamic surface.
Volumetric Visualization: Instead of thin lines, the indicator uses a neon-glow "Surface" with vertical gradients. This represents the total "Energy" currently held by the trend.
Volatility-Adjusted Noise Filter: Unlike standard oscillators that whipsaw during consolidation, this script utilizes a state-persistent ATR filter. It only updates the "Surface" when market energy moves significantly, effectively silencing the noise of minor price fluctuations.
XAUUSD 15min
Peak-Based Exhaustion Logic: By tracking the Highest energy peaks over a lookback period, the script identifies when a trend's "batteries" are running low—turning the surface blue when momentum begins to stall.
How to Trade with the Energy Surface:
1. Entering the Energy Flow (Momentum Resumption)
Watch for the "Surface" to break above its previous peak. When the color shifts from the "Exhaustion Blue" back to a vibrant Bullish Green or Bearish Red, it signals that the market has finished its rest and is ready to expand the surface area again.
NAS100 15min
Signal: Momentum Increasing alert.
2. Spotting the Blow-Off (Exhaustion Detection)
When the "Surface" is high but begins to contract (falling below its recent high), the trend is becoming "over-extended" or "exhausted." This is the ideal time to take profits or tighten trailing stops.
Visual: The surface turns blue (#5b9cf6) while still at high levels.
NAS100 15 min
3. The Squeeze (Energy Compression)
When the Energy Surface is exceptionally low and the Noise Filter prevents it from fluctuating, the market is in a "coiled spring" state. A sudden expansion of the surface from a flat baseline often precedes a massive directional breakout.
NAS100 15min
4. Baseline Context
Green Surface: Price is above the 200 SMA (Bullish Energy).
Red Surface: Price is below the 200 SMA (Bearish Energy).
Blue Surface: Trend is pausing or mean-reverting (Exhaustion).
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.