Trend Direction Helper (ZigZag and S/R and HH/LL labels)
Aug 30, 2019

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.
Trading & investing are risky and many will lose money in connection with trading and investing activities. All content on this site is not intended to, and should not be, construed as financial advice. Decisions to buy, sell, hold or trade in securities, commodities and other investments involve risk and are best made based on the advice of qualified financial professionals. Past performance does not guarantee future results.
Hypothetical or Simulated performance results have certain limitations. Unlike an actual performance record, simulated results do not represent actual trading. Also, since the trades have not been executed, the results may have under-or-over compensated for the impact, if any, of certain market factors, including, but not limited to, lack of liquidity. Simulated trading programs in general are designed with the benefit of hindsight, and are based on historical information. No representation is being made that any account will or is likely to achieve profit or losses similar to those shown.
Testimonials appearing on this website may not be representative of other clients or customers and is not a guarantee of future performance or success.
As a provider of technical analysis tools and strategies, we do not have access to the personal trading accounts or brokerage statements of our customers. As a result, we have no reason to believe our customers perform better or worse than traders as a whole based on any content, tool, or platform feature we provide.
Charts used on this site are by TradingView in which the majority of our technical indicators are built on. TradingView® is a registered trademark of TradingView, Inc. www.TradingView.com TradingView® has no affiliation with the owner, developer, or provider of the Services described herein.
Market data is provided by CBOE, CME Group, BarChart, Massive, CoinAPI. Select U.S. equities data is provided through Massive. CBOE BZX real-time U.S. equities data is licensed from CBOE and provided through BarChart. Real-time futures data is licensed from CME Group and provided through BarChart. Select cryptocurrency data, including major coins, is provided through CoinAPI. All data is provided “as is” and should be verified independently for trading purposes.
This does not represent our full Disclaimer. Please read our full disclaimer.
© 2026 LuxAlgo Global, LLC.

