OPEN-SOURCE SCRIPT
Quantum Imbalance Trap [MarkitTick]

💡 This advanced analytical tool is a comprehensive market structure and momentum suite designed to identify high-probability institutional-style footprints through structural price imbalances, relative volume anomalies, and dynamic volatility tracking. By integrating a sophisticated multi-layered filtering engine, it provides traders with a complete visual and statistical ecosystem, featuring dynamic risk-to-reward mapping, session-specific filters, advanced RSI divergence checks, and automated JSON webhook alerts for seamless algorithmic integration.
✨ Originality and Utility
What sets this tool apart from conventional momentum oscillators is its holistic, data-driven approach to signal validation. It does not merely detect large candles; it synthesizes the candlestick's body-to-range ratio, compares localized volume to a historical moving average, and optionally requires structural liquidity sweeps and RSI divergences before flagging an event. Furthermore, the inclusion of fully formatted, localized JSON alerts containing precise targets and confidence scores makes this indicator highly utilitarian for traders utilizing automated execution bots. The real-time, non-invasive dashboard completely eliminates the need for manual risk-to-reward drawing tools, drastically reducing cognitive load.
🔬 Methodology and Concepts

The core engine operates on a strict, multi-variable confluence matrix:
🎨 Visual Guide

• Chart Elements
• On-Chart Dashboard
📖 How to Use

⚙️ Inputs and Settings

Every aspect of the logic and visual output is fully customizable through categorized input groups:
• Signal Detection
• Smart Money Concepts
• Order Flow
• Risk Management
• Alerts & Sessions
• Dashboard & Visual Style
🔍 Deconstruction of the Underlying Scientific and Academic Framework
The algorithmic foundation of this indicator heavily relies on volume-weighted price kinematics and statistical normalization. By isolating the body-to-range differential, the code mathematically abstracts the concept of aggressive, one-sided market participation, filtering out symmetric volatility (dojis) in favor of asymmetric momentum. The integration of relative volume acts as an independent confirming variable, a critical tenet in auction market theory, which postulates that true price discovery requires heavy transactional density.
The "Confidence Score" utilizes a multivariate linear normalization technique. It aggregates disparate data arrays—imbalance depth, volume intensity, and momentum velocity—into a bounded 0-100 percentage scale. Crucially, it applies a deterministic penalty if the micro-trend contradicts the macro-trend, rooted in the fractal nature of time-series analysis where higher-degree trends exhibit stronger gravitational pull on price action. Finally, the risk mechanics are anchored in dynamic expectancy models; by utilizing the Average True Range (ATR) multiplied by user-defined R-variables, the script ensures that standard deviation and local variance are constantly factored into target projection, honoring the mathematical realities of market heteroskedasticity.
⚠️ 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.
✨ Originality and Utility
What sets this tool apart from conventional momentum oscillators is its holistic, data-driven approach to signal validation. It does not merely detect large candles; it synthesizes the candlestick's body-to-range ratio, compares localized volume to a historical moving average, and optionally requires structural liquidity sweeps and RSI divergences before flagging an event. Furthermore, the inclusion of fully formatted, localized JSON alerts containing precise targets and confidence scores makes this indicator highly utilitarian for traders utilizing automated execution bots. The real-time, non-invasive dashboard completely eliminates the need for manual risk-to-reward drawing tools, drastically reducing cognitive load.
🔬 Methodology and Concepts
The core engine operates on a strict, multi-variable confluence matrix:
- Imbalance & Volume Detection: Evaluates the specific relationship between a candle's real body and its total range (high-to-low). A signal triggers only if this ratio exceeds a user-defined threshold simultaneously with a volume surge that breaches a defined multiplier of the historical volume SMA.
- Momentum & Trend Alignment: Utilizes a fast versus slow Simple Moving Average crossover to dictate the immediate micro-trend, ensuring signals fire in the direction of the active order flow.
- RSI Divergence: An optional mechanical filter that compares recent price action against a 14-period RSI to locate classic bullish or bearish divergences, adding a layer of exhaustion-reversal logic.
- Liquidity Sweeps: Analyzes recent price nodes to determine if local swing highs or lows were structurally breached (swept) prior to the imbalance, indicating potential trap mechanics.
- MTF Validation: Safely references a non-repainting higher timeframe (HTF) 20-period SMA. It dynamically penalizes the mathematical "Confidence Score" if the micro-signal contradicts the macro trend.
🎨 Visual Guide
• Chart Elements
- Entry Zone Boxes: Semi-transparent cyan boxes indicating the optimal dynamic re-entry area based on a 0.35x ATR modifier.
- Signal Labels: Upward (cyan) or downward (orange) triangles marking the exact trigger candle with localized text.
- Risk-to-Reward Lines: Solid colored lines for the Entry point, dashed deep pink lines for the Stop Loss (SL), and dotted lines for Take Profit (TP) levels 1, 2, and 3.
- Price Labels: Text annotations extending rightward from the action, detailing the exact price coordinate and R-multiple for each respective TP level.
• On-Chart Dashboard
- Positioned in the top-right corner with a sleek, dark-themed background and custom-colored text mappings.
- Row-by-Row Metrics: Displays the asset ticker, localized Micro Trend, HTF Macro Trend, Imbalance Percentage, Volume Spike Percentage, and an aggregated Confidence Score using active visual block meters (█/░).
- Live Tracking: Monitors the active trade state (Long/Short/Idle), current ATR value, dynamically tracked Entry/SL/TP prices, and a live tracking of the floating Risk-to-Reward (R) metric.
📖 How to Use
- Wait for a definitive signal label to plot on the chart, confirming that the baseline imbalance, volume, and enabled filters have aligned.
- Consult the on-chart dashboard to review the "Confidence Score." A higher percentage (closer to 100%), supported by solid block meters and HTF alignment, indicates a structurally superior setup.
- Utilize the automatically generated Entry, Stop Loss, and TP lines to establish risk parameters before executing a position. The shaded zone box identifies an optimal area to scale in.
- For algorithmic setups, configure your external bot to parse the automated JSON alert strings to execute trades completely hands-free based on the indicator's defined R-multiples.
⚙️ Inputs and Settings
Every aspect of the logic and visual output is fully customizable through categorized input groups:
• Signal Detection
- Imbalance Lookback (Bars): Dictates the lookback window for volume averages, momentum SMAs, and localized swing structures.
- ATR Period: The lookback length for the Average True Range calculation, governing dynamic SL distances.
- Body-to-Range Threshold: The minimum percentage the solid candle body must occupy relative to its entire wick-to-wick range.
- Volume Spike Multiplier: The exact threshold multiplier by which current volume must exceed the volume SMA.
- RSI Divergence Confirmation: A toggle to mandate an active RSI divergence for signal validation.
• Smart Money Concepts
- Require Liquidity Sweep: When toggled, the engine mandates a structural sweep of the recent highest high or lowest low before plotting a signal.
• Order Flow
- Higher Timeframe Alignment: Mandates that the localized signal matches the structural bias of a higher timeframe.
- Higher Timeframe: A dropdown selection to dictate the exact MTF resolution referenced (e.g., 60 minutes).
- Dynamic Re-entry Zone: Toggles the persistent forward extension of the Entry Zone boxes for continued visual reference.
• Risk Management
- Stop Loss ATR Multiplier: Defines the precise mathematical distance of the stop loss line, scaling automatically with asset volatility.
- Take Profit 1, 2, and 3 (R-Multiple): Exact floating-point settings to define the distances of targets based strictly on Risk-Reward multiples.
• Alerts & Sessions
- Bullish / Bearish Signal Alert: Toggles for activating the fully structured JSON alert webhooks.
- Enable Session Filter: Activates strict time-based operational windows.
- London / New York Open: Specific boolean toggles to restrict signal detection exclusively to the London (07:00–10:30 UTC) and/or New York (12:30–15:00 UTC) trading sessions.
• Dashboard & Visual Style
- Show Entry Zone / Show Price Labels: Toggles to hide or display specific on-chart visual elements to manage chart clutter.
- Background / Text Colors: Dedicated color pickers for the dashboard table aesthetics.
- Bullish / Bearish / Target Colors: Complete hex/RGB customization for trend alignments, signal labels, and every dynamically drawn Risk-to-Reward line.
🔍 Deconstruction of the Underlying Scientific and Academic Framework
The algorithmic foundation of this indicator heavily relies on volume-weighted price kinematics and statistical normalization. By isolating the body-to-range differential, the code mathematically abstracts the concept of aggressive, one-sided market participation, filtering out symmetric volatility (dojis) in favor of asymmetric momentum. The integration of relative volume acts as an independent confirming variable, a critical tenet in auction market theory, which postulates that true price discovery requires heavy transactional density.
The "Confidence Score" utilizes a multivariate linear normalization technique. It aggregates disparate data arrays—imbalance depth, volume intensity, and momentum velocity—into a bounded 0-100 percentage scale. Crucially, it applies a deterministic penalty if the micro-trend contradicts the macro-trend, rooted in the fractal nature of time-series analysis where higher-degree trends exhibit stronger gravitational pull on price action. Finally, the risk mechanics are anchored in dynamic expectancy models; by utilizing the Average True Range (ATR) multiplied by user-defined R-variables, the script ensures that standard deviation and local variance are constantly factored into target projection, honoring the mathematical realities of market heteroskedasticity.
⚠️ 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.
Script open-source
Nello spirito di TradingView, l'autore di questo script lo ha reso open source, in modo che i trader possano esaminarne e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricordiamo che la ripubblicazione del codice è soggetta al nostro Regolamento.
💡 Proprietary indicators. Original research. Built by analysts who trade.
👑 Premium: markittick.com
📢 Free Telegram: t.me/MarkitTick_Updates
👑 Premium: markittick.com
📢 Free Telegram: t.me/MarkitTick_Updates
Declinazione di responsabilità
Le informazioni e le pubblicazioni non sono intese come, e non costituiscono, consulenza o raccomandazioni finanziarie, di investimento, di trading o di altro tipo fornite o approvate da TradingView. Per ulteriori informazioni, consultare i Termini di utilizzo.
Script open-source
Nello spirito di TradingView, l'autore di questo script lo ha reso open source, in modo che i trader possano esaminarne e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricordiamo che la ripubblicazione del codice è soggetta al nostro Regolamento.
💡 Proprietary indicators. Original research. Built by analysts who trade.
👑 Premium: markittick.com
📢 Free Telegram: t.me/MarkitTick_Updates
👑 Premium: markittick.com
📢 Free Telegram: t.me/MarkitTick_Updates
Declinazione di responsabilità
Le informazioni e le pubblicazioni non sono intese come, e non costituiscono, consulenza o raccomandazioni finanziarie, di investimento, di trading o di altro tipo fornite o approvate da TradingView. Per ulteriori informazioni, consultare i Termini di utilizzo.