All indicators

Trend Direction Helper (ZigZag and S/R and HH/LL labels)

Aug 30, 2019

Static chart image
Support and ResistanceSignalsPatternsPivot Based (Retrospective)

The Trend Direction Helper indicator provides a comprehensive trend analysis toolkit by combining ZigZag lines, support and resistance levels, and market structure labels (HH/LL) into a single technical tool. It is designed to assist traders in identifying market shifts and structural breakouts across various assets and timeframes.

Usage

The Usage section describes how the script can be used to identify market trends and key price levels. The indicator outputs three primary visual components to assist with technical analysis:

  • Trend Labels: The script generates "B" (Buy) or "S" (Sell) labels based on a modified Williams Percent Range (WPR) calculation. These labels signal potential shifts in momentum and trend direction.
  • Support & Resistance: The tool automatically plots horizontal pivot levels. These represent historical price nodes where the market has previously reversed, acting as dynamic floors and ceilings.
  • Market Structure (HH/LL): Using Bill Williams Fractal logic, the script identifies and labels Higher Highs (HH), Lower Highs (LH), Higher Lows (HL), and Lower Lows (LL). This helps in confirming if a market is in an uptrend (HHs and HLs) or a downtrend (LHs and LLs).

Traders can use the ZigZag lines to filter out "market noise" and focus on significant price swings, making it easier to visualize the primary trend.

Details

The script integrates multiple technical concepts to ensure a robust analysis:

  • ZigZag Reversal: The ZigZag logic is based on a percentage reversal method. A new line is only drawn when the price reverses by a user-defined percentage from the previous pivot, ensuring only significant moves are tracked.
  • Pivot Logic: Support and resistance levels are calculated using "Left" and "Right" pivot lookback periods. A "Quick" pivot setting is also included to identify shorter-term reactionary levels.
  • Trend Calculation: The trend direction labels utilize a "Risk" parameter to adjust the sensitivity of the internal WPR-based logic. Higher risk values smooth out the signals, while lower values make them more reactive.

Settings

Trend Direction

  • Show Trend Direction Labels: Toggles the visibility of the primary Buy/Sell labels.
  • Risk: Adjusts the sensitivity of the trend detection logic (higher values result in fewer, slower signals).
  • Size: Changes the visual size of the trend labels on the chart.
  • TEXT Buy/Sell: Allows customization of the text displayed on trend signals.

Support & Resistances

  • Show Supports & Resistances: Toggles the horizontal pivot lines.
  • Left/Right Pivot: Defines the number of bars required to the left and right to confirm a major price pivot.
  • Quick Right Pivot: Defines the bars required for shorter-term support and resistance levels.

HH / LL

  • Show Higher/Highs and Lower Lows labels: Toggles the market structure labels (HH, LH, HL, LL).

Zig Zag

  • Show ZIG ZAG Lines: Toggles the visibility of the connected swing lines.
  • Percent of last pivot price: Sets the percentage threshold required for the ZigZag to plot a new reversal point.

FAQ

How do I adjust the indicator for different timeframes? You should modify the "Risk" and "Percent Reversal" settings. Low-volatility timeframes may require smaller percentage reversals, while higher timeframes often benefit from higher "Risk" values to filter noise.

Do the ZigZag lines repaint? The ZigZag and HH/LL components update as new price extremes are formed to accurately reflect market structure. However, the Trend Direction labels (B/S) are triggered on candle close to provide more stable signals.

How can I access the Trend Direction Helper? You can get access on the LuxAlgo Library for charting platforms like TradingView, MetaTrader (MT4/MT5), and NinjaTrader for free.

Free indicator

Get free access to this indicator on the platforms below.

TradingView
NinjaTrader
MetaTrader 4/5

Unlock the entire LuxAlgo Library

Every indicator, every strategy, full charts, and complete access to Quant — our AI agent.