Swing based support and resistance
Oct 1, 2023

The Swing based support and resistance tool identifies dynamic supply and demand zones based on price swing points to help traders visualize trend transitions and potential entry/exit areas.
Usage
The script is used to identify key pivot zones where price may react. It plots two distinct support and resistance levels based on user-defined swing lengths.
- Trend Identification: When the price is above the calculated level, the script indicates a bullish environment, often marked by "Buy" signals (triangle shapes below the bar). Conversely, when the price is below the level, it indicates a bearish environment with "Sell" signals (triangle shapes above the bar).
- Reversals and Continuations: Traders can look for bullish reversals (e.g., hammer patterns) near the support level or continuations when price bounces off the level.
- Multi-Timeframe Analysis: While Level 1 is calculated on the current chart timeframe, Level 2 is designed to pull data from a Daily ("D") timeframe, providing a higher-level perspective even when trading on lower timeframes like the 1H or 15m.
Details
The indicator calculates levels by detecting swing highs and swing lows. A swing high is defined when the high of the current bar is greater than the highs of the two preceding bars. A swing low is defined when the low of the current bar is lower than the lows of the two preceding bars.
- Level 1: This level updates dynamically based on the current chart's price action. If an uptrend is detected (via a swing high), the support level is set to the recent swing low. If a downtrend is detected, the level is set to the recent swing high.
- Level 2: This follows a similar logic but utilizes
request.securityto fetch levels from the Daily timeframe, offering a "Floating" support/resistance effect that remains stable across intraday movements.
Settings
- Swing Length 1: Determines the sensitivity for the first level calculation.
- Swing Length 2: Determines the sensitivity for the second level (Daily) calculation.
FAQ
How do I use the signals provided by this script?
Signals are generated based on price crossovers and crossunders of the support/resistance levels. A close above a level suggests bullish momentum, while a close below suggests bearish momentum.
Which timeframe is best for this indicator?
The script is versatile but is particularly effective on Daily, Weekly, or Monthly charts. Swing traders should use longer swing lengths, while day traders may prefer shorter lengths.
How can I access this indicator?
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.
Unlock the entire LuxAlgo Library
Every indicator, every strategy, full charts, and complete access to Quant — our AI agent.