All indicators

Swing High/Low Indicator w/ MACD and HTF EMA's

May 10, 2022

Static chart image
Support and ResistanceSignalsMoving AveragesPivot Based (Retrospective)

The Swing High/Low Indicator w/ MACD and HTF EMA's tool identifies key structural points confirmed by momentum and provides higher timeframe trend context to assist in market structure break strategies.

Usage

The indicator is primarily used to identify high-probability market structure breaks in alignment with the primary trend. Users should apply the indicator to their entry timeframe (e.g., 15m) and select their preferred higher timeframe (e.g., 4h) in the settings.

  • Trend Identification: The HTF EMAs provide directional bias. When the Fast EMA is above the Slow EMA, the trend is considered bullish; when below, it is bearish.
  • Confirmed Swings: Swing points are only labeled when confirmed by the MACD histogram. A Swing High requires a positive MACD histogram at the time of the peak, while a Swing Low requires a negative histogram.
  • Entry Signals: Traders often look for a break of a Swing High during a bullish HTF trend or a Swing Low during a bearish HTF trend. After a break occurs, look for pullbacks into liquidity areas like wicks or order blocks before entering in the direction of the EMA trend.
  • Levels: The indicator automatically draws horizontal lines on the most recent confirmed Swing High and Low to highlight potential breakout or reversal levels.

Details

The script utilizes a lookback mechanism to detect swing points, ensuring that the identified high or low is the highest/lowest within a specified range of bars. To filter out noise, it integrates MACD histogram values from the same point in time as the swing.

The Higher Timeframe (HTF) EMAs are calculated by mathematically scaling the EMA lengths based on the ratio between the chart timeframe and the selected HTF resolution. This allows the indicator to project higher timeframe trends directly onto the current chart without the lag or "stepping" often found in traditional MTF security calls.

Settings

Detection

  • Bars back to check for a swing: Sets the number of bars required on either side of a candle to confirm it as a swing point.
  • Show Signal Markers: Toggles the visibility of the "SH" and "SL" labels on the chart.

Timeframe & EMAs

  • Entry / Chart Timeframe: Should be set to match the current chart's timeframe for accurate HTF calculation.
  • EMA Timeframe: The higher timeframe used to determine the directional bias.
  • Fast EMA Length: The period for the faster moving average (relative to the HTF).
  • Slow EMA Length: The period for the slower moving average (relative to the HTF).
  • Show EMA's: Toggles the visibility of the HTF EMA lines.

Display

  • Show Swing Break Entry Levels: Toggles the horizontal lines extending from the most recent swing points.

FAQ

How do I use the Swing High/Low Indicator w/ MACD and HTF EMA's?

You can use it to identify market structure breaks by looking for price to close beyond a confirmed swing level while the HTF EMAs indicate the trade is in the direction of the primary trend.

What does MACD confirmation mean in this script?

It means a Swing High is only valid if the MACD histogram is positive at the peak, and a Swing Low is only valid if the MACD histogram is negative at the trough, helping to filter out weak structural points.

How can I access this tool?

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.