PROTECTED SOURCE SCRIPT
Updated

MRI - Micro Resolution Imaging

45
The MRI - Micro Resolution Imaging Indicator: A Comprehensive Analysis

What Is In the Script

The MRI (Micro Resolution Imaging) Pine Script is a sophisticated technical analysis tool designed to perform forensic-level examinations of market data by peering inside the standard price candlesticks. At its core, the script utilizes the advanced request.security_lower_tf function available in Pine Script version 6 to fetch intrabar data—specifically 1-second, 5-second, or 1-minute data—while the user views a higher timeframe chart. This allows the indicator to deconstruct the internal composition of a single bar to calculate metrics that are usually invisible to standard charting tools. The script is structured around several distinct analytical modules that process this micro-data simultaneously. First, it includes a robust Delta Analysis engine that calculates the net difference between buying and selling pressure, tracking cumulative delta, delta at price extremes, and identifying delta reversals. This is paired with an Absorption and Exhaustion module, which hunts for anomalies where high volume fails to move price (absorption) or where price moves on diminishing volume or climatic volume (exhaustion).

Furthermore, the script incorporates a comprehensive Session Management system specifically tuned for the Indian Standard Time (IST) market hours by default, though it remains adjustable. This system segments the trading day into four critical phases: the Opening Drive, the Initial Balance (IB), the Mid-Session, and the Closing Drive. By tracking the specific price action and volume characteristics within these time windows, the script applies Auction Market Theory principles to determine the day's structural bias. The script also features a dynamic VWAP (Volume Weighted Average Price) calculation that not only plots the session VWAP but analyzes price behavior relative to it, counting reclaims, rejections, and differentiating between initiative and responsive volume flow. Additionally, the script includes a Sweep Detection mechanism that identifies when liquidity has been grabbed below previous lows or above previous highs, differentiating between significant external sweeps and minor internal structure sweeps.

All these disparate data points—delta, volume, structure, time, and volatility—are fed into a central Scoring Algorithm. This algorithm applies user-defined weights to each category (for example, weighting Delta at 25% and Sweeps at 15%) to generate a composite "Confidence Score" ranging from 0 to 100. This score determines the overall market bias (Bullish, Bearish, or Neutral) and the strength of that bias. The output is visualized through a complex display system involving a detailed dashboard table fixed to the bottom of the screen, chart overlay signals such as triangles for entry zones, text labels for specific events like "Sweeps" or "Exhaustion," and dynamic lines representing key levels like the Initial Balance High/Low and the Delta Point of Control (POC).

Specialty of the Script

The primary specialty of the MRI script lies in its ability to synthesize "Order Flow" and "Price Action" into a singular, objective metric. Most technical indicators rely solely on the open, high, low, and close of the current timeframe, which often masks the true intent of market participants. For instance, a candle might close green and look bullish on a 5-minute chart, but the MRI script might reveal that the buying occurred entirely at the bottom of the wick and was followed by massive passive selling (absorption) at the top. This capability to visualize the "texture" of the volume is its greatest strength. It specializes in identifying the difference between aggressive participation and passive positioning. By calculating metrics like "Iceberg Detection"—where sustained volume hits a price level without moving it—the script specializes in revealing institutional footprints that retail traders often miss.

Another significant specialty is its temporal awareness. Unlike a Moving Average or RSI which treats every minute of the trading day equally, the MRI script understands that volume and price action mean different things at different times of the day. A breakout during the "Opening Drive" is treated with different logic and weighting than a move during the "Mid-Session" doldrums. This temporal specialty allows the script to align with the natural rhythm of the market auctions, specifically emphasizing the "Closing Drive" as a period of institutional positioning. The script is also specialized for "Trap Trading." By explicitly coding logic for sweeps of previous session highs and lows followed by a recovery, it is fine-tuned to catch "Turtle Soup" style setups where breakout traders are trapped, and the market reverses. This makes it particularly potent for mean-reversion strategies and fading false breakouts, a specialty that is often difficult to program into standard trend-following indicators.

Uniqueness of the Approach

What renders the MRI script unique is its composite scoring methodology. In the fragmented world of trading indicators, traders often have to look at a Delta oscillator, a separate VWAP indicator, a separate session range indicator, and price action patterns individually, trying to mentally synthesize conflicting signals. The MRI script automates this synthesis. It creates a weighted index of bullishness or bearishness that adjusts in real-time. This uniqueness allows for a reduction in cognitive load; instead of asking "Is delta diverging? Is VWAP holding? Did we sweep the low?", the trader can look at the Confidence Score and the "Confirmations" count in the dashboard. The script’s ability to detect "Imbalance Stacking" adds another layer of uniqueness. It tracks consecutive bars of strong buying or selling imbalances, creating a memory of aggressive order flow that persists beyond the current bar, providing a context that standard indicators lack.

The uniqueness also extends to the "Initiative vs. Responsive" volume analysis relative to VWAP. Standard tools simply show volume. The MRI script categorizes volume based on where it occurs relative to value (VWAP). Buying above value is considered "Initiative" (continuation), while buying below value is considered "Responsive" (bargain hunting). This nuance, derived from Market Profile theory but applied via algorithmic code to intrabar data, provides a unique lens on market psychology that is rarely found in public Pine Scripts. Furthermore, the visualization of the "Delta Point of Control" (δPOC) as a dynamic line on the chart is a unique feature. It highlights the specific price level within the recent range where the most aggressive buying or selling took place, serving as a magnet or support/resistance level that traditional volume-at-price indicators might obscure if they are not configured correctly.

How to Use the Script

To utilize the MRI script effectively, a trader must first apply it to a chart with a timeframe higher than the intrabar timeframe setting. For example, if the script is set to analyze 1-second or 5-second data, the chart should be set to a 5-minute or 15-minute timeframe. This ensures the script has a container (the chart bar) within which to analyze the micro-data. Upon loading, the user should configure the Session Settings to match their specific exchange's opening and closing times, as the default is set to Indian Standard Time (IST). The "Opening Drive" and "Initial Balance" durations should be adjusted to reflect the volatility characteristics of the specific asset being traded. Once configured, the primary interface for usage is the Dashboard located at the bottom center of the screen.

The user should observe the "MRI BIAS" cell in the dashboard, which provides the headline signal (e.g., "BULLISH 72%"). This serves as the primary filter. If the bias is Bullish, the trader should primarily look for long setups. The user should then scan the dashboard rows for corroborating data. For instance, if the bias is Bullish, the user should check if "Delta" is positive, if "Sweeps" shows a checkmark next to "Low," and if price is "Above" VWAP. On the chart itself, the user should look for the colored triangular labels. A green triangle pointing up indicates a bullish signal generated by the algorithm. However, these signals should not be followed blindly. The user must verify the signal against the "Levels" drawn on the chart. An ideal usage involves waiting for price to interact with a key level—such as the dotted line of the Previous Session Low or the dashed line of the IB Low—and then looking for a confirmation signal from the MRI script in the form of a label or a high confidence score.

Interpretations of the Data

Interpreting the MRI data requires understanding the narrative the script is constructing. When the "Absorption" metric in the dashboard highlights high "Bid Absorption" (sellers trying to push down but failing) while the price is at a support level, this should be interpreted as institutional accumulation. It implies that a large limit order is soaking up the selling pressure, often a precursor to a reversal. Conversely, if "Iceberg Detections" are high and the Confidence Score is dropping while price is rising, this should be interpreted as a distribution phase where a major player is hiding their selling inside the upward momentum, signaling a potential top. The "Delta" interpretation goes beyond simple green or red. If the price makes a new high but the "Delta" metric on the dashboard or the cumulative delta plot shows a lower high, this is a "Delta Divergence." It suggests the move is driven by weak retail participation rather than aggressive institutional buying, interpreting the breakout as likely to fail.

The "Sweeps" data interpretation is critical for identifying stop runs. If the dashboard shows "Low Sweeps: 1" and the chart shows a "SWEEP" label at the bottom of a wick, it indicates that the market dipped below a significant structural low to trigger stop-loss orders and attract breakout sellers, only to reverse. This is interpreted as a "Liquidity Grab" and is a strong bullish factor. The "Time Segment" interpretation involves comparing the Opening Drive to the Closing Drive. If the Opening Drive was bullish (Green) and the Closing Drive is also bullish (Green), it interprets the day as having strong, sustained conviction. However, if the Opening Drive was Bullish but the Closing Drive is Bearish, it indicates intra-day rejection and a failure to hold gains, suggesting weakness carrying over into the next session. The VWAP interpretation focuses on "Reclaims." If the counter for "Reclaims" in the dashboard increases, it means price fell below the average but buyers aggressively bid it back up above value, interpreting the average price as a floor of support.

How to Use for Trading

Integrating the MRI script into a live trading strategy involves a process of filtering and execution based on the composite score. A robust trading strategy using this script begins with defining the bias. A trader might decide only to take long trades when the MRI Confidence Score is above 60% and short trades only when it is below 40%. In a trend-following strategy, the trader would look for the "Opening Drive" to establish a direction. If the opening drive bias is Bullish and price breaks above the "IB High" (indicated by the dashed yellow line), the trader enters a long position. The stop loss would be placed below the VWAP line. The trade is held as long as the dashboard indicates "Strong" or "Moderate" bullish strength, and the trader would exit if the bias flips to Neutral or if an "Exhaustion" signal appears at the highs.

For a reversal or counter-trend strategy, the trader focuses entirely on the "Sweep" and "Absorption" metrics. The setup begins when price approaches a "Previous Session Low" (dotted line). The trader waits for price to dip below this line. They do not enter yet. They watch the MRI dashboard for a "Bid Absorption" spike or a "Bullish Divergence" in Delta. Once the candle closes back above the level and the MRI generates a green triangle signal or a "SWEEP" label, the trader enters long. This "Trap and Reverse" strategy uses the MRI’s micro-analysis to confirm that the breakout was false. The target for this trade would be the opposing end of the range, such as the VWAP or the IB High. Finally, the script can be used for risk management. If a trader is in a long position, but the "Iceberg Detection" starts flashing on the ask side and the "Initiative" volume turns negative, the trader uses this early warning to tighten stop losses or take partial profits before the reversal becomes visible on the price chart. The MRI script essentially serves as the trader's copilot, validating the health of the trend or signaling the imminent danger of a reversal through its multi-dimensional scoring system.
Release Notes
Improvements for 1 second intrabar CVD calculations, now uses (close-previous close) method.

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.