HYBRID MARKET SCORE SUITE - Context Engine

Monitoring regular divergences, OB/OS zones, statistical deviations, and 37 metrics simultaneously is impractical to do manually. HMSS - Context Engine updates them every tick in one compact dashboard, with an optional scoring layer.
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐ฏ WHAT IS THIS
HMSS - Context Engine
Performs **Real-Time Monitoring** of 37 technical metrics across 4 fixed timeframes (1H / 4H / 1D / 1W) simultaneously, plus 3 cumulative tools that operate independently of timeframe selection.
It processes market data on a **tick-by-tick** basis without lookahead, designed to detect developing structural imbalances and major trend exhaustion points as they unfold.
Since the indicator analyzes fixed multi-timeframe streams, it is chart TF-independent: switching your main chart timeframe does not affect the internal logic or scoring.
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐ง "SWISS ARMY KNIFE" โ Structural Context Tool
A compact table with extensive data for understanding where you are in the bigger picture:
34 MTF indicators across 4 timeframes (1H / 4H / 1D / 1W):
Divergences (13): RSI DIV, MFI DIV, CCI DIV, CMF DIV, MACD DIV, OBV DIV, Delta DIV, CVD DIV, DRSI DIV, ADX DIV, Elder DIV, Hull MA DIV, Stoch DIV
OB/OS (5): RSI OB/OS, MFI OB/OS, CCI OB/OS, Stoch OB/OS, DRSI OB/OS
Z-Score (9): RSI Z-Score, MFI Z-Score, CCI Z-Score, Stoch Z-Score, DRSI Z-Score, Delta Z-Score, CVD Z-Score, MACD Z-Score, OBV Z-Score
Other (7): CMF Zone, ADX Exhaustion, Elder Force, Williams VixFix (WVF), Volume Climax, ZMO EXT, NW ENV
3 Cumulative Tools (TF-independent): Basis, Williams A/D, PIV DIST (Pivot Distance)
A few "Special" metrics may be less familiar than classic oscillators, so here are quick notes on what they flag (not "better" indicators โ just more niche tools):
- NW ENV (NadarayaโWatson Envelope): A kernel-smoothed price envelope (period 8) with deviation multipliers 2.25 (inner) and 7.75 (extreme). Labels reflect band breaches: !! = price outside the inner band (strong extension), !!! = outside the upper extreme band (rare upside extension), !!!! = outside the lower extreme band (rare downside extension). These are context tags for extension/mean-reversion risk, not trade commands.
- Volume Climax: A Z-Score of volume over 20 periods. Flags unusually high volume above about 1.9ฯ. In practice, it helps highlight โcrowd intensityโ moments: heavy volume on a down candle can resemble panic-like supply; heavy volume on an up candle can resemble aggressive chasing. Treat it as context, not a directional guarantee.
- ZMO EXT: normalized via Z-Score over a 100-bar history. It highlights statistically stretched momentum when it deviates beyond roughly 2.0ฯ from its mean โ a way to spot overheated acceleration.
- Basis: Z-Score of the spread between perpetual futures and spot (Binance Futures Premium Index). High positive Z-Score = buyer overheating, deep negative = panic / liquidity deficit.
- Williams A/D: Cumulative Williams Accumulation/Distribution indicator โ tracks structural accumulation and distribution patterns.
- PIV DIST (Pivot Distance): Percentage distance to the nearest significant Pivot level (weekly or monthly). Includes current, previous, and prior periods. Default is Camarilla (pivot type selectable in settings). Calculates extreme S6/R6 levels via progression. Cell highlights in counter-trend color when distance โค0.5%. Extreme levels (5, 6) are colored unconditionally; Major levels (3, 4) โ only when confirmed by score (|Score| > 1600). Does NOT participate in scoring โ visual tool only.
All of this โ across multiple timeframes simultaneously, in one compact table, without cluttering your chart with a dozen oscillators below. Works on any chart TF โ your timeframe selection does not affect calculations.
Each block can be toggled in settings:
- [-]Divergence Block โ forming regular divergences across oscillators/flows
[-]OB/OS Block โ overbought/oversold zones (RSI/MFI/CCI/Stoch etc.)
[-]Z-Score Block โ statistical deviations in sigmas (ฯ)
[-]Special Indicators Block โ special indicators and regime filters
[-]Cumulative Block โ Basis, Williams A/D, Pivot Distances
[-]Scoring Block โ Hybrid Engine (Score, Pattern, Breakdown, Attention, Trade Type, Veto)
[-]Candle Coloring โ optional highlighting of closed candles based on score level (threshold adjustable, off by default)
Use it as a dashboard for structural market assessment โ a macro lens for trend context and positioning.
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐ง SCORING SYSTEM โ For Structural Imbalances
An innovative data-driven engine that activates during moments of structural imbalance:
โข Calibrated using 380,000+ historical market data records
โข Compares current indicator combinations with historical patterns
โข Assigns a Score when significant combinations are detected
Think of the scoring system as a Seismograph โ it monitors deep market structure, not surface noise. Elevated readings indicate tectonic pressure building up. When it reaches extreme levels, it signals accumulated stress that historically precedes structural shifts โ like seismic tension that eventually releases.
It is designed to assist in identifying the broader trend context and potential structural pivot points, if that aligns with your approach.
The system is calibrated on a multi-month historical dataset of 380,000+ records collected minute-by-minute from cryptocurrency markets (BTC, ETH, SOL). During this period, the market showed both multi-month lows and several ATH (All-Time High) events. Statistical dependencies and indicator combination patterns were identified from this data.
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐ง SCORING ENGINE ARCHITECTURE
Concept & Logic:
This system utilizes a hybrid approach, combining classical technical analysis with statistical profiling. Instead of simply summing up indicator signals, the algorithm compares the current market state against a proprietary database of historical patterns ("Profiles") collected for specific assets.
The calculation logic is layered:
- 1. Base Layer (Indicator Analysis):
The system monitors 34+ metrics (RSI, MFI, Z-Scores, CVD, OBV, ADX, VixFix, etc.).
Standard Deviation (25 pts, Dim Cell): Occurs when an indicator exceeds a standard volatility threshold (e.g., Z-Score > 1.5). This registers as a common local anomaly.
Profile Alignment (50 pts, Bright Cell): Occurs when a value hits specific historical thresholds recorded in the Asset Profile. These are values where structural shifts occurred in the past data samples. - 2. The Core Pattern Recognition (compressed historical scenarios):
The system scans for ~14 compressed market scenarios (Patterns). A pattern becomes active only when its specific "Kernel" of indicators fires simultaneously with a Coverage Ratio > 70%. - 3. Confluence & Weighting:
The final score reflects the density of these matches. It identifies the "Winning Side" (Long vs. Short bias) based on the accumulated weight of base and profile scores.
Score Breakdown (The "X-Ray" Row):
The dashboard displays a breakdown row (L:โฆ S:โฆ C:โฆ A:โฆ K:โฆ) to visualize the components of the Total Score:
- L / S (Baseline): Cumulative weight of active indicators for Long or Short bias.
- C (Core Multiplier): A dynamic coefficient applied when the match with a historical pattern "Kernel" is high.
- A (AddSig): Points for secondary confirming factors that reinforce the active pattern.
- K (Key Features): Internal code for High-Impact Anomalies. These are rare statistical outliers (e.g., extreme Z-Scores > 3.0) that carry significant weight due to their historical correlation with structural expansion.
System States (Dashboard Output):
The text labels on the UI represent the statistical context of the market, not direct trade commands:
- NEUTRAL: Balanced market, no dominant patterns.
- SIGNAL FORMING: Early detection of potential accumulation or distribution structures.
- TREND โ WAIT: Market is in a directional phase; algorithm is monitoring for exhaustion or pivot points.
- ON WATCH: High statistical confluence detected.
- MAYBE LONG/SHORT: Directional statistical bias is present.
- MAX SCORE: Indicates an "Extreme Score" condition. Historically, such values appear during significant structural extensions (Global Lows/Highs) where pattern coverage can approach 100% alongside statistical anomalies.
- BREAKOUT: Context suggests structural continuation or level breach.
Disclaimer: This tool provides a statistical context assessment based on historical pattern matching. "Global Lows/Highs" / "New Low/High" are dataset-derived pattern names, not a directional claim. "Max Score" and "Key Features" describe rarity levels, not guaranteed outcomes. Past market behavior is not indicative of future performance.
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐ก๏ธ DRSI VETO โ SAFETY MECHANISM
Sometimes "the setup exists by score", but the market is structurally overextended โ which can make positioning riskier. This is where DRSI Veto comes in:
If the system indicates LONG, but DRSI Z-Score shows extreme overbought conditions (or vice versa for SHORT), the VETO activates, significantly reducing the final Score.
This helps filter out overextended "exhaustion" setups โ technically valid by score, but stretched enough to increase mean-reversion risk without proper context. A clear VETO label appears in the table.
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐ฏ USE CASES โ WHEN IT WORKS BEST
Dual Purpose: Efficiency & Detection
While the Scoring Engine identifies structural imbalances, the dashboard serves as your primary context workstation. It replaces the need for multiple oscillator panes, keeping your charts clean while providing a "Heads-Up Display" for Oscillators, Money Flow, and Statistical Anomalies across four timeframes at once.
Understanding "Where You Are":
The Context Engine is designed for positional awareness โ understanding the broader trend structure before making decisions. It answers the question: "What is the macro context right now?"
Elevated Score (Not MAX):
An elevated score in the Context Engine often indicates that a strong trend is developing. This is valuable information for avoiding counter-trend positioning during powerful directional moves.
MAX Score โ Rare Structural Events:
The scoring system fires less frequently than its companion (HMSS - Impulse Monitor), but when it does reach MAX Score levels, it indicates extreme structural tension โ the kind that historically precedes major pivots. These are rare events measured in hours or days, not minutes.
When NOT to expect detections:
Markets can and often WILL pivot without the indicator firing. This tool is designed for major structural transitions. Smaller corrections and intraday reversals may occur without elevated readings โ that's what HMSS - Impulse Monitor is for.
This is intentional: higher-score conditions are designed to be relatively rare, not a daily occurrence. If your approach values selectivity, it may help to treat elevated readings as โpatient-waitโ moments โ markets often reward waiting for cleaner, high-confluence regimes rather than forcing a setup every session.
Think of the scoring system as a tectonic pressure gauge โ most of the time it shows normal readings, but when stress accumulates to extreme levels, it provides valuable context for understanding structural risk. It's your seismograph: particularly useful when markets approach rare structural thresholds.
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐ก FORMING DIVERGENCES โ Real-Time Monitoring
Important note for experienced traders:
The indicator shows divergences that are CURRENTLY FORMING, not confirmed ones. This is Real-Time Monitoring mode โ scoring updates every tick, allowing you to see the situation as it develops.
โ ๏ธ No lookahead / no future leak: This script strictly uses lookahead=barmerge.lookahead_off (no future data is used in calculations).
On historical data, scores are displayed based on closed candles. For better historical detail, use lower timeframe candles.
If a "forming" pattern disappears โ this is a normal part of real-time monitoring: the market changes, and the assessment/confluence recalculates accordingly.
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐ DIVERGENCE PERCENTAGES โ WHAT THEY MEAN
Percentages next to divergences show "Divergence Intensity" โ how strongly price and oscillator have diverged between points.
Note: The presence of a divergence itself is factored into the scoring system. However, the percentage values (intensity) are currently NOT included in Score calculation. We may add them in the future if we accumulate sufficient data confirming their statistical significance. For now, percentages serve as a visual hint for your own analysis โ an additional confirmation filter.
Note: The indicator also draws forming divergence lines directly on the price chart โ for 6 key oscillators (RSI, MACD, MFI, CCI, DRSI, CVD).
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐ง SCORING SYSTEM COMPATIBILITY
Statistical data profiles are available for: BTC, ETH, and SOL
โข Default mode is AUTO: BTC/ETH/SOL detected automatically; all other assets use 'ALTS' (ETH-based) profile
โข Manual Override: You can select a specific profile in settings if Bar Replay testing shows it tracks your asset's volatility better
โข Indicator readings as tools work on ANY assets and markets
โข For non-crypto instruments (Forex, Stocks): if alerts trigger too often or too rarely, adjust MAX SCORE Thresholds in settings
Note: Alert threshold settings (Base, Total, MAX SCORE) also affect "Attention Level" and "Trade Type" display in the UI.
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐ ALERT SYSTEM (4-STEP)
The alert system is tiered (each step can be toggled on/off):
- [-]Step 1: Base Score โ Triggers when mathematical confluence reaches base threshold
[-]Step 2: Core Pattern โ Triggers when algorithmic pattern is detected (Breakout/Formation)
[-]Step 3: Total Score โ Triggers when total Score reaches threshold
[-]Step 4: MAX SCORE Alert โ Final high-score alert (individual thresholds for BTC/ETH/SOL/ALT)
Important: Alert thresholds simultaneously calibrate Attention and Trade Type in the UI.
For automation (bots / webhook-based tools): use Webhook URL. Keep in mind that maximum score is often reached at the wick tip, not at candle close โ backtesting on longer TFs may show delayed data.
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐งฉ HMSS ECOSYSTEM: HMSS - Context Engine vs. HMSS - Impulse Monitor
This script (HMSS - Context Engine) is one half of a specialized two-module system. It is designed to work either as a standalone tool or alongside its companion, HMSS - Impulse Monitor.
Why separate scripts? To maximize responsiveness and detail without hitting Pine Script resource limits (memory/execution time), the ecosystem is split into two specialized engines. Merging them would compromise real-time performance.
Note: HMSS - Impulse Monitor is not a different preset of the same script โ it is a separate engine with its own indicator set, pattern library, and calibration profiles designed for a different purpose and a different analytical scope.
Key Differences & Synergy:
- [-]Distinct Purpose (Macro vs. Micro):HMSS - Context Engine (This Script): Designed for "Market Context." It analyzes 1H/4H/1D/1W structures to identify global trends and major structural pivots. HMSS - Impulse Monitor (Companion): Designed for "Market Reaction." It monitors 5m/15m/30m specifically to detect local exhaustion, liquidation wicks, and immediate imbalances.
[-]Distinct Indicator Sets: Each engine includes components better suited for its timeframe domain. HMSS - Context Engine features structure-oriented indicators: ADX Exhaustion, OBV Divergence & Z-Score, Delta Histograms, VixFix (WVF), Basis, Williams A/D, and Pivot Distances. HMSS - Impulse Monitor incorporates VWAP Deviation and ATR Spikes โ metrics more relevant for intraday dynamics.
[-]Distinct Calibration Profiles: While both engines are developed using historical market observations, their pattern libraries and threshold values are calibrated independently for their respective metric sets and use-cases. The same market event may register as "Extreme" on HMSS - Context Engine while appearing "Neutral" on HMSS - Impulse Monitor if local momentum remains stable โ and vice versa.
๐ก Synergy Scenarios (How to use them together): Experienced traders often combine both modules to refine market context and decision-making:
โข Trend Pullback: If HMSS - Context Engine indicates a strong Trend, but HMSS - Impulse Monitor shows "Extreme Overbought/Oversold" (correction against trend) โ this often highlights a short-term counter-trend move within a larger structural trend.
โข Major Reversal Risk: If BOTH HMSS - Context Engine and HMSS - Impulse Monitor indicate "Max Score" / "Extreme Imbalance" simultaneously โ this is a rare statistical event (confluence of macro and micro exhaustion) that historically correlates with significant structural reversals.
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ๏ธ TECHNICAL NOTES
๐ฐ๏ธ Real-Time Monitor (No Past Labels):
Crucial Concept: This tool is a Real-Time Monitor, not a "signal painter." It shows the market state HERE AND NOW โ it does NOT draw historical Buy/Sell arrows or preserve past dashboard states. The only elements drawn on the chart are currently forming divergence lines.
Calculation Heavy:
We utilize maximum Pine Script limits for calculations. Initial loading may take up to 12-15 seconds โ this reflects the precision and volume of processed data. After loading, the indicator operates without noticeable delays, processing data every tick.
Chart TF Independence:
The indicator analyzes fixed MTF streams, so your chart timeframe selection does not affect results. For reduced load and faster response, 5-60 minute charts are preferred.
Recommended Chart Timeframe:
- [-]For speed and lower load: 5โ60 minutes (optimal)
[-]For detailed history, you can go down to lower timeframes, but this is a performance/memory tradeoff
Bar Replay โ How to See Past Performance:
To understand how the Scoring Engine reacted to specific market moves (e.g., a past crash or pump), use Bar Replay Mode:
- [-]1s to 30s: Best accuracy (precise tick-emulation)
[-]1 min: Acceptable (if your plan lacks seconds-based intervals)
[-]Higher TFs: Works, but for best detail โ especially to see MAX Score events โ lower TFs are recommended
To manage the extensive database of pattern weights and profiles while maintaining high performance, this engine utilizes a custom optimized data structure. This ensures the script operates smoothly within Pine Script's resource limits without compromising the depth of historical analysis.
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐ฌ TECHNICAL APPROACH (for the curious)
The indicator uses a proprietary compact data encoding system that allows transmitting information about divergences, their type, length, and intensity in a single numeric value. This enables efficient aggregation of data from multiple timeframes without exceeding Pine Script limits.
The scoring system is built on the Statistical Pattern Matching principle: current indicator combinations are compared against a library of statistically significant patterns, each with its own weight and type (Formation/Breakout).
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐ QUICK START
- [-]Add HYBRID MARKET SCORE SUITE - Context Engine to your chart.
[-]Position table (recommended: bottom-right) and adjust Offset / Spacer so it doesn't overlap price action.
[-]In settings, toggle blocks by groups: Divergences / OB-OS / Z-Score / Special / Cumulative / Scoring โ to match your trading style and load preferences.
[-]For comfortable operation, use chart TF 5โ60m.
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐ DEVELOPMENT
The indicator receives periodic updates, including statistical pattern refinements as new market data is accumulated, to maintain relevance with current market conditions. Update schedule is not guaranteed.
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
๐ก๏ธ DISCLAIMER
This script is provided for informational and educational purposes only and does NOT constitute financial advice, investment advice, or a recommendation to buy/sell any asset.
All examples, descriptions, and statistics are based on historical observations. Market conditions can change, patterns can fail, and signals/labels may disappear or update in real time. No results are guaranteed.
Use this tool as one input among many. Always apply your own judgment, risk management, and independent verification (DYOR). Trading โ especially with leverage โ involves substantial risk, including the risk of total loss. You are solely responsible for your decisions and outcomes.
Skrip jemputan sahaja
Hanya pengguna disahkan oleh penulis boleh mengakses skrip ini. Anda perlu memohon dan mendapatkan kebenaran untuk menggunakannya. Keizinan selalunya diberikan selepas pembayaran. Untuk lebih butiran, ikuti arahan penulis di bawah atau hubungi MAXmks secara terus.
TradingView TIDAK menyarankan pembayaran atau penggunaan skrip kecuali anda mempercayai sepenuhnya penulis dan memahami bagaimana ia berfungsi. Anda juga boleh menjumpai alternatif sumber terbuka dan percuma yang lain di dalam skrip komuniti kami.
Arahan penulis
Penafian
Skrip jemputan sahaja
Hanya pengguna disahkan oleh penulis boleh mengakses skrip ini. Anda perlu memohon dan mendapatkan kebenaran untuk menggunakannya. Keizinan selalunya diberikan selepas pembayaran. Untuk lebih butiran, ikuti arahan penulis di bawah atau hubungi MAXmks secara terus.
TradingView TIDAK menyarankan pembayaran atau penggunaan skrip kecuali anda mempercayai sepenuhnya penulis dan memahami bagaimana ia berfungsi. Anda juga boleh menjumpai alternatif sumber terbuka dan percuma yang lain di dalam skrip komuniti kami.