OPEN-SOURCE SCRIPT
Güncellendi

Liquidity Sweep Candlestick Pattern with MA Filter

18 403
📌 Liquidity Sweep Candlestick Pattern with MA Filter

This custom indicator detects liquidity sweep candlestick patterns—price action events where the market briefly breaks a previous candle’s high or low to trap traders—paired with optional filters such as moving averages, color change candles, and strictness rules for better signal accuracy.

🔍 What is a Liquidity Sweep?

A liquidity sweep occurs when the price briefly breaks the high or low of a previous candle and then reverses direction. These events often occur around key support/resistance zones and are used by institutional traders to trap retail positions before moving the price in the intended direction.

🟢 Bullish Liquidity Sweep Criteria

The current candle is bullish (closes above its open).

The low of the current candle breaks the low of the previous candle.

The candle closes above the previous candle’s open.

Optionally, in Strict mode, it must also close above the previous candle’s high.

Optionally, it can be filtered to only show if the candle changed color from the previous one (e.g., red to green).

Can be filtered to only show when the price is above or below a moving average (if MA filter is enabled).

🔴 Bearish Liquidity Sweep Criteria

The current candle is bearish (closes below its open).

The high of the current candle breaks the high of the previous candle.

The candle closes below the previous candle’s open.

Optionally, in Strict mode, it must also close below the previous candle’s low.

Optionally, it can be filtered to only show if the candle changed color from the previous one (e.g., green to red).

Can be filtered to only show when the price is above or below a moving average (if MA filter is enabled).

⚙️ Features & Customization

✅ Signal Strictness

Choose between:

Less Strict (default): Basic wick break and close conditions.

Strict: Must close beyond the wick of the previous candle.

✅ Color Change Candles Only

Enable this to only show patterns when the candle color changes (e.g., from red to green or green to red). Helps filter fake-outs.

✅ Moving Average Filter (optional)

Supports several types of MAs: SMA, EMA, WMA, VWMA, RMA, HMA

Choose whether signals should only appear above or below the selected moving average.

✅ Custom Visuals

Show short (BS) or full (Bull Sweep / Bear Sweep) labels

Plot triangles or arrows to represent bullish and bearish sweeps

Customize label and shape colors

Optionally show/hide the moving average line

✅ Alerts

Includes alert options for:

Bullish sweep

Bearish sweep

Any sweep

📈 How to Use

Add the indicator to your chart.

Configure the strictness, color change, or MA filters based on your strategy.

Observe signals where price is likely to reverse after taking out liquidity.

Use with key support/resistance levels, order blocks, or volume zones for confluence.

⚠️ Note
This tool is for educational and strategy-building purposes. Always confirm signals with other indicators, context, and sound risk management.

Sürüm Notları
Updated Features
Three Signal Strictness Levels:
Added a new "Least Strict" option alongside "Strict" and "Less Strict".

Least Strict: Identifies bullish signals as green candles that sweep the previous candle’s low, and bearish signals as red candles sweeping the previous candle’s high, without additional close price requirements.

Less Strict and Strict levels retain their original logic with increasing signal strictness.
Sürüm Notları
Renamed options in the MA filter "Choose Condition" dropdown input to:

"Bull Sweep Above MA, Bear Sweep Below MA"

"Bull Sweep Below MA, Bear Sweep Above MA"
Sürüm Notları
✅ Update: Added “Same Color Candles Only” Filter
This new filter allows signals to trigger only when the current and previous candles are the same color (both bullish or both bearish).

🟢 Example: Two green candles in a row for a bullish signal
🔴 Example: Two red candles in a row for a bearish signal

❗ Note: This filter is mutually exclusive with the existing “Color Change Candles Only” option.
You can use one or the other, but not both at the same time.

Feragatname

Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, işlem veya diğer türden tavsiye veya tavsiyeler anlamına gelmez ve teşkil etmez. Kullanım Şartları'nda daha fazlasını okuyun.