PROTECTED SOURCE SCRIPT

Institutional Market Structure Pro [JOAT]

103
Institutional Market Structure Pro – SMC, MTF Momentum & Z-Score Confluence Engine

IMPORTANT NOTES (READ FIRST)
  • This is an indicator (not a strategy). It does not place trades. It provides a structured confluence framework combining market structure, momentum, and statistical analysis.
  • This script is written in Pine Script v6 and is intended to be used on standard candlestick charts.
  • Source code visibility: This script is published as Protected Source (closed-source). The purpose is to protect the work from unauthorized re-uploads/copies and to maintain a stable versioning path. This description is intentionally detailed so you can understand what the indicator does and how to use each feature without needing access to the implementation.
  • Non-Repainting: HTF data uses confirmed historical values with proper offset, ensuring reliable signals for live trading.


Protected Source / Closed-Source Clarification
  • Protected source does not mean "trust me blindly". It means the internal implementation is not publicly viewable.
  • The operational behavior is documented here: what is plotted, what each dashboard cell means, what each input controls, and how to interpret the output.
  • If you see re-uploads or near-identical copies elsewhere, treat them with caution and rely on the official publication.


Overview
Institutional Market Structure Pro (IMS Pro) is a comprehensive technical analysis indicator designed to help traders identify market structure shifts, momentum alignment, and statistical price extremes. It combines:
  • Smart Money Concepts (SMC) – Swing highs/lows, Change of Character (CHoCH), Break of Structure (BOS)
  • Higher Timeframe Momentum – MACD-based institutional bias from configurable HTF
  • Statistical Z-Score Analysis – Standard deviation bands identifying statistically extreme price levels
  • Trend Cloud – EMA-based short-term trend visualization
  • Confluence Scoring – Four-factor system combining all layers into actionable bias


The indicator was developed to address a common challenge: most retail traders struggle to identify when institutional order flow is shifting direction. By combining market structure analysis with higher timeframe momentum and statistical deviation measurements, IMS Pro helps traders see the market through an institutional lens.

What Makes It Original (Originality & Usefulness)
This script is not a simple mashup of SMC concepts. It is a coordinated workflow:
  • Market Structure Layer identifies swing highs, swing lows, and structural breaks (CHoCH and BOS) using configurable pivot detection
  • Momentum Layer analyzes higher timeframe MACD to determine institutional momentum bias with non-repainting implementation
  • Statistical Layer calculates Z-Score deviation bands to identify statistically extreme price levels where reversals are more likely
  • Confluence Scoring combines all layers into a single actionable bias score (STRONG BULL to STRONG BEAR)


When these three layers align, the indicator provides high-probability trading opportunities. The dashboard displays real-time confluence scoring so traders can quickly assess market conditions.


1) Chart Visuals – What You See on the Chart

A) Swing Highs and Swing Lows
The indicator identifies swing points using a configurable pivot detection algorithm:
  • Swing Highs – Red circles above the price level where they formed
  • Swing Lows – Green circles below the price level where they formed
  • Pivot Sensitivity – Controls how many bars are required to confirm a swing point (default: 10 bars)


Higher pivot sensitivity values result in fewer but more significant swing points. Lower values capture more swings but may include noise.

B) Change of Character (CHoCH)
A Change of Character occurs when price breaks a swing level in the opposite direction of the current trend, signaling a potential trend reversal:
  • Bullish CHoCH – Price breaks above a swing high while the market was previously in bearish structure. Displayed as a green dashed line with "CHoCH" label.
  • Bearish CHoCH – Price breaks below a swing low while the market was previously in bullish structure. Displayed as a red dashed line with "CHoCH" label.


CHoCH signals are significant because they indicate that the side previously in control (buyers or sellers) has lost dominance. These are often the first signs of a trend reversal.

C) Break of Structure (BOS)
A Break of Structure occurs when price breaks a swing level in the same direction as the current trend, confirming trend continuation:
  • Bullish BOS – Price breaks above a swing high while already in bullish structure. Displayed as a light green solid line with "BOS" label.
  • Bearish BOS – Price breaks below a swing low while already in bearish structure. Displayed as a light red solid line with "BOS" label.


BOS signals confirm that the current trend remains intact and the dominant side maintains control.

D) Z-Score Deviation Bands
Statistical bands showing price deviation from mean:
  • Upper Band (+2 sigma) – Light red line showing the overbought threshold
  • Lower Band (-2 sigma) – Light green line showing the oversold threshold
  • Mean Line – Gray line showing the statistical average price
  • Extreme Markers – Diamond shapes appear when price first enters extreme zones


Statistical Probability Context:
  • 68% of price action occurs within +/- 1 standard deviation
  • 95% of price action occurs within +/- 2 standard deviations
  • 99.7% of price action occurs within +/- 3 standard deviations


When price reaches +/- 2 standard deviations, there is only a 5% probability of it moving further in that direction, making these levels statistically significant for potential reversals.

E) Trend Cloud
Visual representation of short-term trend direction using two EMAs (9 and 21):
  • Green Cloud – Fast EMA is above slow EMA, indicating bullish short-term momentum
  • Red Cloud – Fast EMA is below slow EMA, indicating bearish short-term momentum


F) HTF Momentum Background Tint
Subtle background coloring based on higher timeframe MACD:
  • Green Background Tint – Higher timeframe momentum is bullish (MACD line > signal line)
  • Red Background Tint – Higher timeframe momentum is bearish (MACD line < signal line)
  • No Tint – Momentum is neutral or the feature is disabled



2) IMS PRO Dashboard – Full Glossary
A compact table displays real-time summary of all analysis layers:

Header Row
  • Displays "IMS PRO" and current symbol
  • Color changes based on overall bias (green for bullish, red for bearish)


Row 1 – Structure
  • BULLISH: Higher highs and higher lows pattern
  • BEARISH: Lower highs and lower lows pattern
  • NEUTRAL: Mixed swings, ranging/consolidating market


Row 2 – HTF
  • Shows higher timeframe momentum bias with selected timeframe in parentheses
  • BULLISH: MACD line > signal line on HTF
  • BEARISH: MACD line < signal line on HTF


Row 3 – Z-Score
  • Displays current Z-Score value with color coding
  • Green for positive, red for negative
  • Bright colors for extreme values (beyond +/- 2)


Row 4 – Trend
  • UP: Fast EMA > Slow EMA
  • DOWN: Fast EMA < Slow EMA
  • RANGING: EMAs approximately equal


Row 5 – Overall Bias
  • STRONG BULL: Score +3 to +4 (all factors aligned bullish)
  • BULL: Score +1 to +2 (majority of factors bullish)
  • NEUTRAL: Score 0 (mixed signals)
  • BEAR: Score -1 to -2 (majority of factors bearish)
  • STRONG BEAR: Score -3 to -4 (all factors aligned bearish)


Row 6 – Swing High
  • Price level of the most recent swing high
  • Useful for stop loss and target placement


Row 7 – Swing Low
  • Price level of the most recent swing low
  • Useful for stop loss and target placement



3) How the Confluence Scoring Works (High-Level)

IMS Pro uses a four-factor confluence scoring system:
  • Market Structure (+1/-1): Bullish structure adds +1, bearish structure adds -1
  • HTF Momentum (+1/-1): Bullish HTF momentum adds +1, bearish adds -1
  • Trend Direction (+1/-1): Uptrend adds +1, downtrend adds -1
  • Z-Score Position (+1/-1): Z-Score above +0.5 adds +1, below -0.5 adds -1


Score Interpretation:
  • Score +3 to +4 = STRONG BULL – All factors aligned bullish
  • Score +1 to +2 = BULL – Majority of factors bullish
  • Score 0 = NEUTRAL – Mixed signals
  • Score -1 to -2 = BEAR – Majority of factors bearish
  • Score -3 to -4 = STRONG BEAR – All factors aligned bearish


Z-Score Calculation:
  • Z-Score = (Price - Mean) / Standard Deviation
  • Mean and StdDev calculated over configurable lookback period (default: 75)
  • Z-Score = 0 means price is at the mean
  • Z-Score = +2 means price is two standard deviations above mean (statistically overbought)
  • Z-Score = -2 means price is two standard deviations below mean (statistically oversold)



4) Inputs & Settings – Full Reference

Market Structure Settings
  • Pivot Sensitivity (default: 10): Number of bars to confirm swing points. Range: 2-50.
  • Show Last N Bars (default: 500): Limits historical display for performance.
  • Show Swing Highs: Toggle swing high markers.
  • Show Swing Lows: Toggle swing low markers.
  • Show CHoCH: Toggle Change of Character labels.
  • Show BOS: Toggle Break of Structure labels.
  • Swing High Color (default: red): Color for swing high markers.
  • Swing Low Color (default: green): Color for swing low markers.


Higher Timeframe Momentum Settings
  • Enable HTF Momentum: Toggle HTF analysis.
  • Higher Timeframe (default: 240/4H): Timeframe for momentum analysis.
  • MACD Fast Length (default: 12): Fast EMA period for MACD.
  • MACD Slow Length (default: 26): Slow EMA period for MACD.
  • MACD Signal Length (default: 9): Signal line period.
  • Show HTF Bias Background: Toggle background tint.
  • Bias Background Transparency (default: 92): Opacity of background tint.


Statistical Analysis Settings
  • Enable Z-Score Analysis: Toggle statistical analysis.
  • Z-Score Lookback (default: 75): Period for mean and standard deviation calculation.
  • Show Extreme Deviation Bands: Toggle +/- 2 sigma bands.
  • Extreme Z-Score Threshold (default: 2.0): Z-Score level considered extreme.


Visual Settings
  • Show Information Dashboard: Toggle dashboard display.
  • Dashboard Position (default: Top Right): Corner placement for dashboard.
  • Color Bars by Trend: Toggle bar coloring based on confluence.
  • Show Trend Cloud: Toggle EMA cloud display.
  • Cloud Transparency (default: 85): Opacity of trend cloud fill.


Alert Settings
  • Alert on CHoCH: Enable CHoCH alerts and visual markers.
  • Alert on BOS: Enable BOS alerts and visual markers.
  • Alert on Extreme Z-Score: Enable extreme zone alerts and markers.



5) Recommended Workflow (Practical Use)

Step 1: Identify Market Structure
  • Observe swing highs and swing lows to understand current structure
  • Higher highs + higher lows = Bullish structure
  • Lower highs + lower lows = Bearish structure
  • Mixed swings = Ranging/consolidating market


Step 2: Check Higher Timeframe Bias
  • Look at background tint and dashboard HTF reading
  • Trading with HTF momentum increases probability of success


Step 3: Wait for Structure Breaks
  • For trend reversals: Wait for CHoCH signals that align with HTF momentum
  • For trend continuation: Wait for BOS signals that confirm existing trend


Step 4: Consider Statistical Context
  • Avoid buying when Z-Score is extremely positive (overbought)
  • Avoid selling when Z-Score is extremely negative (oversold)
  • Look for reversals when price reaches extreme bands


Step 5: Assess Overall Confluence
  • STRONG BULL = High-probability long setups
  • STRONG BEAR = High-probability short setups
  • NEUTRAL = Wait for clearer signals


Recommended Timeframe Settings:
  • For 15-minute charts: Use 4H (240) higher timeframe
  • For 1-hour charts: Use Daily (D) higher timeframe
  • For 4-hour charts: Use Weekly (W) higher timeframe



6) Alerts
IMS Pro ships with alert conditions for:
  • Bullish CHoCH: Triggers when a bullish Change of Character is detected
  • Bearish CHoCH: Triggers when a bearish Change of Character is detected
  • Bullish BOS: Triggers when a bullish Break of Structure is detected
  • Bearish BOS: Triggers when a bearish Break of Structure is detected
  • Extreme Overbought: Triggers when Z-Score first exceeds the extreme threshold
  • Extreme Oversold: Triggers when Z-Score first drops below the negative extreme threshold
  • Bullish Confluence: Triggers when CHoCH + HTF Bullish + Oversold Z-Score align
  • Bearish Confluence: Triggers when CHoCH + HTF Bearish + Overbought Z-Score align


The confluence alerts are particularly valuable as they only trigger when multiple factors align, filtering out lower-probability setups.


7) Limitations & Best-Use Guidance
  • Market structure analysis works best in trending markets; may produce mixed signals in choppy conditions.
  • Higher timeframe data requires sufficient historical bars to calculate accurately.
  • Z-Score assumes normal distribution which may not hold during extreme market events.
  • Past structural patterns do not guarantee future price behavior.
  • The indicator is a tool for analysis, not a standalone trading system.
  • Always validate on your own symbols and timeframes before committing capital.


Best Practices:
  • Always trade in the direction of the higher timeframe momentum
  • Use CHoCH signals for potential reversals, BOS signals for continuations
  • Avoid entries when Z-Score is at extremes against your trade direction
  • Wait for STRONG BULL or STRONG BEAR confluence for highest probability trades
  • Adjust pivot sensitivity based on your trading timeframe (higher for swing trading, lower for day trading)
  • Use the swing high and swing low levels from the dashboard for stop loss and target placement



Disclaimer

This script is for educational and informational purposes only. It does not constitute financial advice or a recommendation to buy or sell any financial instrument. Trading involves substantial risk of loss. Past performance of any trading methodology is not indicative of future results. Users should conduct their own research and consult with qualified financial advisors before making trading decisions. The author is not responsible for any losses incurred from using this indicator.


-Made with passion by officialjackofalltrades

Feragatname

Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, alım satım veya diğer türden tavsiye veya öneriler anlamına gelmez ve teşkil etmez. Kullanım Koşulları bölümünde daha fazlasını okuyun.