HTF Swing Structure Signals
By LuxAlgoJul 22, 2026

The HTF Swing Structure Signals indicator provides a comprehensive framework for identifying high probability market structure shifts and pullback zones aligned with higher timeframe trends. This tool combines multi timeframe trend analysis, automated swing point detection, and dynamic Fibonacci retracement levels to help traders pinpoint optimal entry opportunities that align with institutional momentum.
# Usage
The HTF Swing Structure Signals indicator serves as a multi layered analytical tool designed to simplify complex price action concepts. Traders can use it to determine directional bias and identify specific zones where price is likely to react following a break in market structure.
### Trend Alignment and Market Structure The script visualizes market structure by identifying Break of Structure (BOS) and Change of Character (CHoCH) events. By integrating a Higher Timeframe (HTF) Exponential Moving Average, the indicator filters market structure signals. When the price is above the HTF EMA, the script emphasizes bullish structure, and when below, it prioritizes bearish structure. This helps traders avoid trading against the primary market trend.
### Fibonacci Retracement Setups The indicator automatically draws 50 percent Fibonacci retracement levels upon the formation of valid market structure breaks. If a breakout occurs in the direction of the HTF trend, the script plots a dotted line and an active 50 percent retracement level. A signal is generated (indicated by triangles above or below the bars) when the price touches this 50 percent retracement zone, offering a structured approach to entering pullbacks.
# Details
The execution of this script relies on a custom swing detection algorithm that utilizes pivot points to isolate significant highs and lows. Once a pivot is broken, the script marks the event as either a BOS or a CHoCH.
The logic for Fibonacci calculations is triggered specifically when market conditions meet the user defined requirements, such as the Counter Trend BOS rule. This rule ensures that if you are looking for trend aligned setups, the indicator waits for a prior counter trend break before confirming the validity of a new impulse move. The indicator maintains an active state for these levels until the price touches the retracement zone or until a specified maximum number of bars has elapsed, ensuring that only fresh, relevant setups remain on your chart.
# Settings
### EMA Settings
- Higher Timeframe: Defines the timeframe for the EMA (e.g., Daily, 4-hour) to establish the primary trend bias.
- EMA Length: Sets the number of bars used to calculate the exponential moving average.
### Market Structure Settings
- MS Pivot Period: Determines the sensitivity of the swing point detection for BOS and CHoCH labels.
- Fib Pivot Period: Controls the lookback period for identifying significant swing points used for the Fibonacci retracement levels.
- Max Bars for Fib to Disappear: Limits how long an active 50 percent Fibonacci level stays on the chart before expiring.
- Require Counter-Trend BOS for Setup: When enabled, this filter ensures that trend aligned setups only appear if a counter trend break has occurred first, increasing the quality of the signals.
- Bullish Structure Color: Customizes the color for bullish structure labels and lines.
- Bearish Structure Color: Customizes the color for bearish structure labels and lines.
# FAQ
### How do I access the HTF Swing Structure Signals indicator? You can get access on the LuxAlgo Library for charting platforms like TradingView, MetaTrader (MT4/MT5), and NinjaTrader for free.
### Does this indicator work on all timeframes? Yes, the script is designed to be flexible. While it performs best on assets with clear trends, the Higher Timeframe EMA input allows you to anchor your analysis to a longer period regardless of your current chart interval.
### Can I change the sensitivity of the swing points? Absolutely. You can adjust the MS Pivot Period and the Fib Pivot Period in the settings menu to detect either more frequent, minor swings or fewer, more significant market structure points.
Free indicator
Get free access to this indicator on the platforms below.
Unlock the entire LuxAlgo Library
Every indicator, every strategy, full charts, and complete access to Quant — our AI agent.