OPEN-SOURCE SCRIPT

Triangular Hull Moving Average [BigBeluga X PineIndicators]

7 737
This strategy is based on the original Triangular Hull Moving Average (THMA) + Volatility indicator by BigBeluga. Full credit for the concept and design goes to BigBeluga.

The strategy blends smoothed trend-following logic using a Triangular Hull Moving Average with dynamic volatility overlays, providing actionable trade signals with responsive visual feedback. It's designed for traders who want a non-lagging trend filter while also monitoring market volatility in real time.

How the Strategy Works
1. Triangular Hull Moving Average (THMA) Core
At its core, the strategy uses a Triangular Hull Moving Average (THMA) — a variation of the traditional Hull Moving Average with triple-smoothing logic:
  • It combines multiple weighted moving averages (WMAs) to create a faster and smoother trend line.
  • This reduces lag without compromising trend accuracy.
  • The THMA reacts more responsively to price movements than classic MAs.


THMA Formula:
thma(_src, _length) =>
ta.wma(ta.wma(_src,_length / 3) * 3 - ta.wma(_src, _length / 2) - ta.wma(_src, _length), _length)

This logic filters out short-term noise while still being sensitive to genuine trend shifts.

2. Volatility-Enhanced Candle Plotting
An optional volatility mode overlays the chart with custom candles that incorporate volatility bands:
  • Wicks expand and contract dynamically based on market volatility.
  • The volatility value is computed using a HMA of high-low range over a user-defined length.
  • The candle bodies reflect THMA values, while the wicks reflect the current volatility spread.


This feature allows traders to visually gauge the strength of price moves and anticipate possible breakouts or slowdowns.

3. Trend Reversal Signal Detection
The strategy identifies trend reversals when the THMA line crosses over/under its own past value:
  • A bullish signal is triggered when THMA crosses above its value from two bars ago.
  • A bearish signal is triggered when THMA crosses below its value from two bars ago.
  • These shifts are marked on the chart with triangle-shaped signals for clear visibility.


This logic helps detect momentum shifts early and enables reactive trade entries.

Trade Entry & Exit Logic
Trade Modes Supported
Users can choose between:
  • Only Long – Enters long trades only.
  • Only Short – Enters short trades only.
  • Long & Short – Enables both directions.


Entry Conditions
  • Long Entry:

    Triggered when a bullish crossover is detected.

    Active only if the strategy mode allows long trades.

  • Short Entry:

    Triggered when a bearish crossover is detected.

    Active only if the strategy mode allows short trades.


Exit Conditions
  • In Only Long mode, the strategy closes long positions when a bearish signal appears.
  • In Only Short mode, the strategy closes short positions when a bullish signal appears.


In Long & Short mode, the strategy does not auto-close positions — instead, it opens new positions on each confirmed signal.

Dashboard Visualization
In the bottom-right corner of the chart, a live dashboard displays:
  • The current trend direction (🢁 for bullish, 🢃 for bearish).
  • The current volatility level as a percentage.


This helps traders quickly assess market status and adjust their decisions accordingly.

Customization Options
  • THMA Length: Adjust how smooth or reactive the trend detection should be.
  • Volatility Toggle & Length: Enable or disable volatility visualization and set sensitivity.
  • Color Settings: Choose colors for up/down trend visualization.
  • Trade Direction Mode: Limit the strategy to long, short, or both types of trades.


Use Cases & Strategy Strengths
1. Trend Following
Use the THMA-based candles and triangle signals to enter with momentum. The indicator adapts quickly, reducing lag and improving trade timing.

2. Volatility Monitoring
Visualize the strength of the trend with volatility wicks. Use expanding bands to confirm breakouts and contracting ones to detect weakening moves.

3. Signal Confirmation
Combine this tool with other indicators or use the trend shift triangles as confirmations for manual entries.

Conclusion
The THMA + Volatility Strategy is a non-repainting trend-following system that integrates:
  • Triangular Hull MA for advanced trend detection.
  • Real-time volatility visualization.
  • Clear entry signals based on trend reversals.
  • Configurable trade direction settings.


It is ideal for traders who:
  • Prefer smoothed price analysis.
  • Want to follow trends with precision.
  • Value visual volatility feedback for breakout detection.


Full credit for the original concept and indicator goes to BigBeluga.

면책사항

이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.