OPEN-SOURCE SCRIPT

Liquidity Entry Signals [MarkitTick]

18 837
💡 A comprehensive, multi-faceted approach to identifying potential market reversals based on classic liquidity sweep mechanics. By scanning for instances where price briefly breaches a significant structural high or low before immediately rejecting and closing back within the range, this tool highlights areas where trap-based price dynamics may be in play. It is designed to offer a complete trading framework rather than just a simple signal, integrating dynamic stop-loss and take-profit plotting, real-time advanced dashboard analytics, and comprehensive alert payloads. This indicator assists in bridging the gap between raw price action analysis and structured trade management.

● ✨ Originality and Utility

Many basic technical indicators simply look for higher highs or lower lows without assessing the quality of the rejection. This script elevates that concept by requiring strict closing conditions to validate a sweep. What truly sets it apart is its integration of multiple intelligent filters. Rather than relying on price action alone, users can mandate that sweeps align with the prevailing trend, occur during periods of sufficient volatility, and are backed by relative volume strength.

Additionally, the built-in risk management visualizations automatically calculate position risk parameters right on the chart. By projecting stop-loss and take-profit levels based on current volatility, it transforms a static signal into an actionable trade plan. The inclusion of dynamic JSON payload generation for alerts also makes this an incredibly versatile tool for those looking to automate their execution through third-party platforms.

● 🔬 Methodology and Concepts
快照
The core logic of this script is built around the concept of a liquidity sweep, verified through price action closes, and filtered through statistical market conditions.

  • Bullish Sweep: The script continuously calculates the lowest low over a user-defined lookback window. A valid bullish signal occurs when the current bar's lowest price penetrates this recent low, but the closing price decisively reclaims it by closing higher than the structural low and higher than its own open.
  • Bearish Sweep: Conversely, the script identifies the highest high over the recent lookback period. If the current bar's high breaches this level, but the close falls below the recent high and below its own open, a short signal is triggered.
  • Trend Filtration: The indicator uses a Simple Moving Average (SMA) on both the current chart and a selected higher timeframe to establish a directional bias. Signals that conflict with these moving average baselines are suppressed to prevent counter-trend trading.
  • Volatility and Volume Analysis: The script evaluates the Average True Range (ATR) as a percentage of the current closing price to ensure sufficient market movement is present. It also compares the current volume to a standard moving average of volume, filtering out setups that lack participation.


● 🎨 Visual Guide
快照
The script draws extensive visual overlays to assist in real-time decision-making and trade management.

• Signal Labels
When a valid sweep occurs, an "LS" label is plotted. Green labels positioned below the candle indicate bullish setups, while red labels above indicate bearish setups.

• Trade Execution Lines
Upon a signal, the indicator projects trade management lines directly on the chart for the next 50 bars.
  • Entry Line: A dashed blue line marking the closing price of the signal bar.
  • Stop Loss (SL): A solid red line placed away from the entry, calculated based on the ATR multiplied by the user's risk factor.
  • Take Profit (TP): Three dashed teal lines representing Take Profit 1, 2, and 3. These are calculated using specific Risk-to-Reward multiples of the stop-loss distance.


• Risk and Reward Zones
Semi-transparent colored fills visually separate the trade zones. A red fill highlights the risk zone between the entry and the stop loss, while a teal fill highlights the reward zone extending from the entry to the final take-profit level.

• Advanced Dashboard
A multi-row informational table appears in the selected corner of the chart. This dashboard provides a real-time status check of the prevailing trend bias, the number of bars since the last signal, exact entry/SL/TP price levels, current ATR, and visual progress bars for volatility and signal cooldown periods.

● 📖 How to Use
快照
Traders can utilize this script as a complete top-down methodology for analyzing market structure. First, observe the dashboard to confirm that the current market environment aligns with your desired filters (e.g., ensuring the higher timeframe trend is supportive and volume thresholds are met).

When a valid "LS" label appears on the chart, immediately note the projected Entry, Stop Loss, and Take Profit lines. The dashed blue line serves as your reference for a potential entry point. You can calculate your position sizing based on the fixed distance between this blue Entry line and the solid red Stop Loss line.

The three Take Profit levels allow for a tiered approach to trade management, enabling partial profit-taking as the price advances in your favor. Advanced users can configure the custom string inputs to send highly detailed webhook payloads directly to execution platforms, passing the exact dynamically calculated price levels directly to their broker.

● ⚙️ Inputs and Settings

The script is highly customizable through categorized input groups, allowing adaptation to any asset class or timeframe.

• SMC Settings
  • Sweep Lookback: Defines the number of historical bars used to calculate the structural high and low points.


• Smart Filters
  • Trend Filter: Enables an SMA condition to dictate the allowed signal direction.
  • Volatility Filter: Requires the ATR to be a minimum percentage of the asset's price before a signal can fire.
  • Volume Filter: Demands that the current bar's volume exceeds a defined multiple of the volume moving average.
  • HTF Timeframe: Selects the specific higher timeframe used for long-term trend alignment.
  • Signal Cooldown: Prevents consecutive signals within a specified number of bars to reduce chart noise during extended consolidations.


• Trade Tools
  • SL ATR Mult: Determines the distance of the Stop Loss based on the current ATR, adjusting risk based on market volatility.
  • TP1 / TP2 / TP3 RR: Sets the specific Risk-to-Reward multiples for the three profit targets.


• Alerts
  • Action Strings: Customizable fields to inject specific commands into the JSON alert payloads for entries, exits, and partial take-profits.


● 🔍 Deconstruction of the Underlying Scientific and Academic Framework

From a market microstructure perspective, liquidity sweeps represent a temporary imbalance in supply and demand. In auction market theory, price frequently probes beyond established boundaries to test for the presence of resting orders. When price penetrates a historical extreme but fails to sustain value there—evidenced by the immediate reversal and closing within the prior range—it indicates an absorption of liquidity by counter-trend market participants. This exhaustion of directional momentum is a well-documented phenomenon in order flow analysis.

To normalize these price extensions, the indicator applies the Average True Range (ATR). Developed by J. Welles Wilder, the ATR provides a robust statistical measure of absolute price volatility, capturing gaps and limit moves that standard standard-deviation metrics might underrepresent. By tying the Stop Loss logic directly to the ATR, the indicator adapts to heteroskedasticity, which is the changing variance of asset returns over time. This ensures that risk parameters dynamically widen during highly volatile periods to prevent premature stop-outs, and contract during quiet phases to optimize capital efficiency.

Furthermore, the reliance on moving averages for trend and volume filtration applies fundamental time-series smoothing. This inherently mitigates the noise of high-frequency price fluctuations, ensuring that the localized microstructure event (the sweep) is aligned with the macro directional drift of the broader dataset.

⚠️ Disclaimer
All provided scripts and indicators are strictly for educational exploration and must not be interpreted as financial advice or a recommendation to execute trades. We expressly disclaim all liability for any financial losses or damages that may result, directly or indirectly, from the reliance on or application of these tools. Market participation carries inherent risk where past performance never guarantees future returns, leaving all investment decisions and due diligence solely at your own discretion.

免責聲明

這些資訊和出版物並非旨在提供,也不構成TradingView提供或認可的任何形式的財務、投資、交易或其他類型的建議或推薦。請閱讀使用條款以了解更多資訊。