All indicators

HTF SuperTrend for Scalping

Apr 26, 2022

Static chart image
Support and ResistanceSignalsVolatility

The HTF SuperTrend for Scalping indicator provides traders with a higher-timeframe perspective of market trends to filter out noise on lower-timeframe charts, specifically designed for scalping strategies. By projecting SuperTrend data from a higher interval onto the current chart, it helps traders maintain a directional bias and identify support/resistance "defense lines" based on volatility.

Usage

The tool is primarily used to align lower-timeframe execution with higher-timeframe trends. For example, a scalper working on a 5-minute chart might set the Higher TimeFrame setting to 15 minutes. This ensures that the scalp entries are taken in the direction of the more significant trend, reducing the impact of the "whipsaws" often associated with short-term SuperTrend calculations.

The indicator plots a main SuperTrend line alongside three "Defense Lines" and a "Loss Cut" line. These levels act as dynamic areas of interest:

  • Trend Direction: Trade long when the HTF SuperTrend is bullish (green) and short when it is bearish (red).
  • Defense Lines: These serve as potential areas for profit-taking or zones where the trend might encounter temporary resistance or support before continuing.
  • Loss Cut: A projected level that indicates a potential trend invalidation point beyond the standard trailing stop.

Details

The script utilizes the request.security() function to fetch OHLC and ATR data from a user-defined timeframe. It calculates the standard SuperTrend logic (Average True Range multiplied by a factor) but applies it to the higher-timeframe data.

To provide more granularity for scalping, the script calculates several internal levels between the trend line and its opposite boundary:

  • Defense Lines: These are derived using percentage offsets (similar to Fibonacci levels) between the current Trailing Stop Loss (TSL) and the opposite boundary.
  • Loss Cut Line: This represents a level calculated using a negative percentage offset from the TSL, providing a visual buffer for stop placement.

Settings

  • Higher TimeFrame: Defines the timeframe from which the SuperTrend data is pulled (e.g., 15m, 1h, 4h).
  • Factor: The multiplier applied to the ATR to determine the distance of the SuperTrend line.
  • Period: The lookback period used for the ATR calculation.
  • Loss Cut: An integer value representing the percentage offset for the stop-loss level.
  • 1st/2nd/3rd Defence Line: Integer values that determine the percentage levels for the three defense lines plotted relative to the trend.

FAQ

How do I access the HTF SuperTrend for Scalping?

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

Why is the trend line flat in some sections?

Because the indicator uses a higher timeframe, the line updates only when a candle on that higher timeframe closes. On your current lower-timeframe chart, this appears as a "stepped" or flat line until the next HTF interval completes.

Can I use this for swing trading?

Yes. While optimized for scalping by using 5m/15m combinations, you can use any timeframe pair (e.g., 1h/4h or 4h/Daily) to suit longer-term trading styles.

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.