DC Swing Liquidity Sweep Bias

Description
The DC Swing Liquidity Sweep Bias indicator is a bias-tracking tool for NinjaTrader 8 that detects directional tendencies based on liquidity sweeps occurring during Donchian Channel (DC) swings. This indicator integrates internal logic from the DC Extremes Gap Threshold to monitor when price levels are swept—indicative of stop runs or liquidity grabs—and tracks their frequency during swing formations.
It evaluates both upward and downward swings using short-term Donchian Channel breaks and assigns a directional bias if the number of sweeps during the swing exceeds a user-defined threshold. The output can be used as a standalone bias filter or integrated into broader trading strategies.
This bias indicator helps traders determine the prevailing pressure—bullish or bearish—driven by liquidity dynamics, allowing for more informed trade selection and directional filtering.
Key Features:
- Bias Tracking via Liquidity Sweeps: Monitors price sweeps at potential reversal zones during Donchian Channel-based swings.
- Swing-Based Filtering: Only considers sweeps that occur within valid upward or downward swing segments.
- Integrated with DC Extremes: Leverages the DC Extremes Gap Threshold logic to detect valid swept levels.
- Customizable Sensitivity: Parameters include sweep thresholds, swing durations, and embedded level validation settings.
- Visual Output: Plots directional bias using clear triangle markers—up for bullish bias, down for bearish bias.
- Inversion Capability: Can invert the signal output if used for contrarian setups or system integrations.
Tips for Implementation:
- Trend Confirmation: Use the bias output to confirm the direction of your primary trade setup.
- Timing Swings: Align entries with the swing structure by filtering signals based on sweep-validated biases.
- Combine with Momentum: Pair with momentum indicators to confirm conviction in the bias direction.
- Adjust Swing Sensitivity: Tailor SwingDCPeriod, MinSwingBars, and MaxSwingBars to match intraday or swing timeframes.
- Backtest for Sweep Sensitivity: Fine-tune the MinLiquiditySweeps threshold based on the asset's volatility and liquidity profile.
Parameters
001 Parameters
Min Liquidity Sweeps
- Type: int
- Description: Minimum number of liquidity sweeps that must occur during a swing for a bias signal to be generated. This helps confirm meaningful liquidity events.
- Default Value: 1
- Valid Values: Any positive integer greater than or equal to 1
Swing DC Period
- Type: int
- Description: Lookback period for the Donchian Channel used to define swing highs and lows. Shorter periods detect quicker swings.
- Default Value: 3
- Valid Values: Any positive integer greater than or equal to 1
Min Swing Bars
- Type: int
- Description: Minimum number of bars that a swing must span to be considered valid. Helps avoid very short, noisy swings.
- Default Value: 1
- Valid Values: Any positive integer greater than or equal to 1
Max Swing Bars
- Type: int
- Description: Maximum number of bars a swing may span while still being valid for bias detection. Filters out overly slow moves.
- Default Value: 50
- Valid Values: Any positive integer greater than or equal to 1
Max Bias Validity
- Type: int
- Description: Number of bars the bias signal remains active once triggered, allowing flexibility in how long the signal influences trade logic.
- Default Value: 5
- Valid Values: Any positive integer greater than or equal to 1
Invert Bias Direction
- Type: bool
- Description: If enabled, inverts the direction of the bias signal. Useful for contrarian strategies or custom system integration.
- Default Value: false
- Valid Values: true / false
002 Levels Parameters
Level DC Period
- Type: int
- Description: Sets the period for the primary Donchian Channel, which determines the high and low extremes used to identify potential support and resistance levels for sweep detection.
- Default Value: 5
- Valid Values: Any positive integer greater than or equal to 1
Min Bars Since HL
- Type: int
- Description: Minimum number of bars that must pass since a high or low was formed for the level to be considered valid. This avoids reacting to immature price extremes.
- Default Value: 5
- Valid Values: Any positive integer greater than or equal to 1
Max Bars Since HL
- Type: int
- Description: Maximum number of bars within which the level must be activated after forming. Ensures the level is formed by a swift move rather than a slow grind.
- Default Value: 50
- Valid Values: Any positive integer greater than or equal to 1
Min FVGs Since HL
- Type: int
- Description: Minimum number of Fair Value Gaps that must appear since the last high or low for a level to be eligible. Adds confluence through imbalance detection.
- Default Value: 0
- Valid Values: Any non-negative integer
Min Ticks
- Type: int
- Description: Minimum price gap in ticks required for the level to be recognized as valid. Acts as a threshold to filter out minor fluctuations.
- Default Value: 10
- Valid Values: Any non-negative integer
Min ATR Multiple
- Type: int
- Description: Minimum gap size expressed as a multiple of the ATR, ensuring that sweeps occur during significant volatility.
- Default Value: 1
- Valid Values: Any non-negative integer
Min Range Percent
- Type: int
- Description: Minimum percentage of the Donchian Channel range required for the level to be considered meaningful in terms of market breadth.
- Default Value: 0
- Valid Values: Any non-negative integer
Min Current Day Range Percent
- Type: int
- Description: Minimum percentage of the current day’s trading range needed to validate a level. Helps avoid setups during low-volatility conditions.
- Default Value: 0
- Valid Values: Any non-negative integer
ATR Period
- Type: int
- Description: Lookback period used to calculate the Average True Range for volatility-based level filtering.
- Default Value: 20
- Valid Values: Any positive integer greater than or equal to 1
Range DC Period
- Type: int
- Description: Lookback period for the secondary Donchian Channel, used to assess the broader price range context.
- Default Value: 100
- Valid Values: Any positive integer greater than or equal to 1
Bars Validity
- Type: int
- Description: Number of bars a level remains valid unless completed or invalidated by price action.
- Default Value: 200
- Valid Values: Any positive integer greater than or equal to 1
Sessions Validity
- Type: int
- Description: Number of full trading sessions a level remains valid. Useful for time-filtered level expiration.
- Default Value: 1
- Valid Values: Any positive integer greater than or equal to 1
Plots
BiasUp
- Type: Plot
- Style: Triangle Up
- Color: Green
- Description: Signals a bullish bias when sufficient upward liquidity sweeps are detected during a swing low. Used to confirm potential long setups.
BiasDown
- Type: Plot
- Style: Triangle Down
- Color: Red
- Description: Signals a bearish bias when sufficient downward liquidity sweeps are detected during a swing high. Used to confirm potential short setups.
