OPEN-SOURCE SCRIPT
Supply & Demand Order Blocks [JOAT]

Supply and Demand Order Blocks [JOAT]
Detects institutional order blocks from displacement, tracks them until mitigated, and signals reactions when price returns to a fresh zone.

What it is
Large participants cannot fill size at a single price, so they leave a footprint: the last opposing candle before an aggressive, imbalanced push. That candle marks the zone where unfilled orders rest and where price often returns to be re-accumulated or re-distributed. This indicator locates those zones objectively, manages their lifecycle, and frames the reaction as a trade. It is an original order-block engine with strict zone management.
How it works
• Displacement — the engine measures each impulsive leg over a short window against an ATR multiple. Only moves that exceed that threshold (optionally requiring a fair-value gap) count as institutional displacement, filtering out ordinary candles.
• Order block — the last opposing candle before a qualifying displacement is stored as a zone: the last down candle before a bullish push becomes demand, the last up candle before a bearish push becomes supply.
• Zone management — active blocks are held in parallel arrays, drawn as boxes extended to the right, faded by age and saturated by displacement strength, pruned once mitigated (price closes through them), and capped at a live maximum so the chart stays clean.
• Signals — a Buy fires when price taps a fresh demand block and closes back up (a bullish rejection); a Sell is the mirror at a supply block. An optional trend filter keeps you buying demand in uptrends and selling supply in downtrends, and a minimum-age plus minimum-gap rule stops a freshly formed block from self-triggering and prevents clustering.
Trade levels
Each signal draws a red risk box from entry to a stop placed beyond the block and a green reward box to the third target, with inner dividers and right-edge labels for entry, stop and each take-profit at your R multiples.
The dashboard
An adjustable order-flow-depth panel shows the trend bias, the live counts of demand and supply blocks, the distance to the nearest zone, a conviction estimate, the active signal, and a live first-target-before-stop tally from closed bars only.
How to use it
• Works on any asset and timeframe; larger timeframes produce fewer, more significant blocks.
• Trade reactions at fresh, unmitigated zones aligned with the trend filter; treat mitigated zones as spent.
• Use the nearest-zone distance to anticipate where a reaction may occur before it happens.
Settings
Displacement window and ATR size, fair-value-gap requirement, maximum live blocks and extension, minimum block age, trend filter length, risk buffer and target R multiples, plus visual and dashboard controls.
Originality and usefulness
The contribution is the full lifecycle model: an ATR-based displacement filter, objective block selection, age-and-strength-aware zone rendering, mitigation-based pruning, and a self-trigger guard — combined with a trend-filtered, non-repainting reaction signal and explained end to end.
Notes and limitations
• Not every tap of a zone reverses; blocks can and do break, which is why mitigation pruning and stops exist.
• Order-block definitions vary between traders; this engine uses one consistent, disclosed definition.
• The tally reflects only past bars on the current chart and is not a forecast.
• Educational and analytical tool, not financial advice.
— made with passion by officialjackofalltrades
Detects institutional order blocks from displacement, tracks them until mitigated, and signals reactions when price returns to a fresh zone.
What it is
Large participants cannot fill size at a single price, so they leave a footprint: the last opposing candle before an aggressive, imbalanced push. That candle marks the zone where unfilled orders rest and where price often returns to be re-accumulated or re-distributed. This indicator locates those zones objectively, manages their lifecycle, and frames the reaction as a trade. It is an original order-block engine with strict zone management.
How it works
• Displacement — the engine measures each impulsive leg over a short window against an ATR multiple. Only moves that exceed that threshold (optionally requiring a fair-value gap) count as institutional displacement, filtering out ordinary candles.
• Order block — the last opposing candle before a qualifying displacement is stored as a zone: the last down candle before a bullish push becomes demand, the last up candle before a bearish push becomes supply.
• Zone management — active blocks are held in parallel arrays, drawn as boxes extended to the right, faded by age and saturated by displacement strength, pruned once mitigated (price closes through them), and capped at a live maximum so the chart stays clean.
• Signals — a Buy fires when price taps a fresh demand block and closes back up (a bullish rejection); a Sell is the mirror at a supply block. An optional trend filter keeps you buying demand in uptrends and selling supply in downtrends, and a minimum-age plus minimum-gap rule stops a freshly formed block from self-triggering and prevents clustering.
Trade levels
Each signal draws a red risk box from entry to a stop placed beyond the block and a green reward box to the third target, with inner dividers and right-edge labels for entry, stop and each take-profit at your R multiples.
The dashboard
An adjustable order-flow-depth panel shows the trend bias, the live counts of demand and supply blocks, the distance to the nearest zone, a conviction estimate, the active signal, and a live first-target-before-stop tally from closed bars only.
How to use it
• Works on any asset and timeframe; larger timeframes produce fewer, more significant blocks.
• Trade reactions at fresh, unmitigated zones aligned with the trend filter; treat mitigated zones as spent.
• Use the nearest-zone distance to anticipate where a reaction may occur before it happens.
Settings
Displacement window and ATR size, fair-value-gap requirement, maximum live blocks and extension, minimum block age, trend filter length, risk buffer and target R multiples, plus visual and dashboard controls.
Originality and usefulness
The contribution is the full lifecycle model: an ATR-based displacement filter, objective block selection, age-and-strength-aware zone rendering, mitigation-based pruning, and a self-trigger guard — combined with a trend-filtered, non-repainting reaction signal and explained end to end.
Notes and limitations
• Not every tap of a zone reverses; blocks can and do break, which is why mitigation pruning and stops exist.
• Order-block definitions vary between traders; this engine uses one consistent, disclosed definition.
• The tally reflects only past bars on the current chart and is not a forecast.
• Educational and analytical tool, not financial advice.
— made with passion by officialjackofalltrades
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
The AI Trading Ecosystem, Built to win trades 📈
Get Full Access 👇
jackofalltrades.vip 🌐
t.me/jackofalltradesvip 🃏
Get Full Access 👇
jackofalltrades.vip 🌐
t.me/jackofalltradesvip 🃏
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
The AI Trading Ecosystem, Built to win trades 📈
Get Full Access 👇
jackofalltrades.vip 🌐
t.me/jackofalltradesvip 🃏
Get Full Access 👇
jackofalltrades.vip 🌐
t.me/jackofalltradesvip 🃏
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.