OPEN-SOURCE SCRIPT
SMC Supply & Demand Probability Engine (Legacy Open Source)

DESCRIPTION:
Introduction
Welcome to the Legacy Open Source Edition of the SMC Supply & Demand Probability Engine. In the spirit of contributing to the Pine Script community, I have decided to open the source code of this previous iteration (V16) completely. This allows developers and advanced traders to study, modify, and dissect the underlying array-based logic and scoring mechanics.
Please note that this is a legacy version. For our highly optimized, distraction-free execution engine, check out the newly released SMC PRO (V18) and SMC PRO MAX (V19) on my profile.
Core Architecture & Proprietary Logic Inside:
1. Institutional Accumulation Engine (0 - 100%)
Not all demand zones are created equal. This open-source script contains the full logic for calculating institutional buying phases by analyzing 5 specific criteria (scoring up to 20 points each):
a. Sequence: Checks if the demand correctly formed after a supply mitigation.
b. Validity: Ensures the demand zone hasn't been structurally violated.
c. Time-Based Inventory: Measures the duration of the accumulation phase (the longer the base, the stronger the potential expansion).
d. Supply Pressure Absence: Scans for any immediate opposing supply zones that might suppress the price.
e. Pre-BOS Support: Evaluates structural momentum before the breakout.
- Output States: "NO INTEREST" ➔ "PROBING" ➔ "EARLY ACCUM" ➔ "COMMIT" ➔ "EXPANSION".
2. Probability Engine V2 (0 - 100%)
Before entering a trade, the dashboard assesses the setup's win probability based on:
b. Range Quality: Measures the entry position relative to the SMC High/Low logarithmic range.
c. Demand Distance: Proximity of the entry to the absolute bottom of the demand zone.
d. Supply Risk: Detects immediate danger areas (Supply Near EX) that could act as roadblocks.
e. Momentum Continuity: Ensures the trend aligns with the structural break.
3. Advanced Trade Management & Auto-Killswitch
- Dynamic TP & SL: Calculates Take Profit levels using Logarithmic Fibonacci scaling to map targets accurately on chart visualizations.
- Auto-Killswitch Protection: If the calculated Risk:Reward ratio for TP2 falls below 0.60 due to a massive stop-loss distance, the script will automatically invalidate the setup.
- Scale-In (Avg Up) Protocol: Identifies opportunities to add to a winning position once the structure confirms momentum, complete with a visual "Danger Area" risk box (±25% risk boundary).
How to Read the Legacy Dashboard
- SIDE & ACCUM: Direction of the trade and the current institutional accumulation percentage.
- ENTRY & SL: Exact price levels for execution and protection.
- TP (Skip Aware): Dynamic targets based on Logarithmic Fibonacci extensions.
- CONFIDENCE & PROBABILITY: A star-rating system (1 to 5 stars) interpreting the setup's strength.
- STATUS & ACTION: Tells you exactly what stage the trade is in ("WAIT", "ACTIVE", "AVG UP").
Usage Note
As this code is now fully Open Source, feel free to use snippets for your own Pine Script utilities. Always use strict risk management. Past performance mapped by the script does not guarantee future market behavior.
Introduction
Welcome to the Legacy Open Source Edition of the SMC Supply & Demand Probability Engine. In the spirit of contributing to the Pine Script community, I have decided to open the source code of this previous iteration (V16) completely. This allows developers and advanced traders to study, modify, and dissect the underlying array-based logic and scoring mechanics.
Please note that this is a legacy version. For our highly optimized, distraction-free execution engine, check out the newly released SMC PRO (V18) and SMC PRO MAX (V19) on my profile.
Core Architecture & Proprietary Logic Inside:
1. Institutional Accumulation Engine (0 - 100%)
Not all demand zones are created equal. This open-source script contains the full logic for calculating institutional buying phases by analyzing 5 specific criteria (scoring up to 20 points each):
a. Sequence: Checks if the demand correctly formed after a supply mitigation.
b. Validity: Ensures the demand zone hasn't been structurally violated.
c. Time-Based Inventory: Measures the duration of the accumulation phase (the longer the base, the stronger the potential expansion).
d. Supply Pressure Absence: Scans for any immediate opposing supply zones that might suppress the price.
e. Pre-BOS Support: Evaluates structural momentum before the breakout.
- Output States: "NO INTEREST" ➔ "PROBING" ➔ "EARLY ACCUM" ➔ "COMMIT" ➔ "EXPANSION".
2. Probability Engine V2 (0 - 100%)
Before entering a trade, the dashboard assesses the setup's win probability based on:
b. Range Quality: Measures the entry position relative to the SMC High/Low logarithmic range.
c. Demand Distance: Proximity of the entry to the absolute bottom of the demand zone.
d. Supply Risk: Detects immediate danger areas (Supply Near EX) that could act as roadblocks.
e. Momentum Continuity: Ensures the trend aligns with the structural break.
3. Advanced Trade Management & Auto-Killswitch
- Dynamic TP & SL: Calculates Take Profit levels using Logarithmic Fibonacci scaling to map targets accurately on chart visualizations.
- Auto-Killswitch Protection: If the calculated Risk:Reward ratio for TP2 falls below 0.60 due to a massive stop-loss distance, the script will automatically invalidate the setup.
- Scale-In (Avg Up) Protocol: Identifies opportunities to add to a winning position once the structure confirms momentum, complete with a visual "Danger Area" risk box (±25% risk boundary).
How to Read the Legacy Dashboard
- SIDE & ACCUM: Direction of the trade and the current institutional accumulation percentage.
- ENTRY & SL: Exact price levels for execution and protection.
- TP (Skip Aware): Dynamic targets based on Logarithmic Fibonacci extensions.
- CONFIDENCE & PROBABILITY: A star-rating system (1 to 5 stars) interpreting the setup's strength.
- STATUS & ACTION: Tells you exactly what stage the trade is in ("WAIT", "ACTIVE", "AVG UP").
Usage Note
As this code is now fully Open Source, feel free to use snippets for your own Pine Script utilities. Always use strict risk management. Past performance mapped by the script does not guarantee future market behavior.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.