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
開源腳本
秉持TradingView一貫精神,這個腳本的創作者將其設為開源,以便交易者檢視並驗證其功能。向作者致敬!您可以免費使用此腳本,但請注意,重新發佈代碼需遵守我們的社群規範。
The AI Trading Ecosystem, Built to win trades 📈
Get Full Access 👇
jackofalltrades.vip 🌐
t.me/jackofalltradesvip 🃏
Get Full Access 👇
jackofalltrades.vip 🌐
t.me/jackofalltradesvip 🃏
免責聲明
這些資訊和出版物並非旨在提供,也不構成TradingView提供或認可的任何形式的財務、投資、交易或其他類型的建議或推薦。請閱讀使用條款以了解更多資訊。
開源腳本
秉持TradingView一貫精神,這個腳本的創作者將其設為開源,以便交易者檢視並驗證其功能。向作者致敬!您可以免費使用此腳本,但請注意,重新發佈代碼需遵守我們的社群規範。
The AI Trading Ecosystem, Built to win trades 📈
Get Full Access 👇
jackofalltrades.vip 🌐
t.me/jackofalltradesvip 🃏
Get Full Access 👇
jackofalltrades.vip 🌐
t.me/jackofalltradesvip 🃏
免責聲明
這些資訊和出版物並非旨在提供,也不構成TradingView提供或認可的任何形式的財務、投資、交易或其他類型的建議或推薦。請閱讀使用條款以了解更多資訊。