OPEN-SOURCE SCRIPT
Order Block Engine [JOAT]

═══ ORDER BLOCK ENGINE [JOAT] ═══
Most order-block tools paint a fresh box on every candle and bury the chart. This one does the opposite. It only marks the last opposing-close candle that appears just before a genuine displacement leg — a move that closes through a confirmed swing by more than a volatility-scaled threshold, backed by a volume expansion. The result: only a handful of clean, unmitigated, high-grade zones survive on screen at once.

▎ WHAT IT DOES
It maps institutional-style order blocks, grades each one from 0 to 10 by ★ quality, extends the surviving zones to the right until price mitigates them, and fires a single clean BUY / SELL pill on a valid retest + reaction — complete with an R-multiple TP/SL zone construct. A grey/white and blue-chrome dashboard keeps the running read of structure, bias and zone quality in one corner.
▎ HOW IT WORKS
— Confirmed swing structure. Pivot highs and lows are tracked with a configurable lookback. Each swing stays "unbroken" until price genuinely closes through it.
— Displacement break. A bullish break needs an up-close candle that closes above the last swing high by more than Displacement × ATR; a bearish break mirrors it below the swing low. ATR scaling means the threshold self-adjusts to any asset or timeframe.
— Volume confirmation. The breaking candle's volume must exceed its own moving-average baseline by the chosen multiplier. On symbols with no volume feed, this filter auto-skips.
— Order-block selection. Once a break is confirmed, the engine walks back through recent bars to find the last opposing-close candle — the down-close before a bullish break, or the up-close before a bearish break. That candle's high/low becomes the zone.
— ★ Grade (0-10). Each block is scored on three factors: how far the break displaced (in ATR), how strong the volume expansion was, and the body-to-range ratio of the origin candle. The composite maps to a 0-10 grade and a tier (WEAK → FAIR → SOLID → STRONG → ELITE).
— Mitigation & signals. Live zones extend right on each bar. If price closes fully through a zone, it is mitigated — frozen and greyed (or deleted). If instead price wicks back into the zone and the bar reacts back out with a close in the right direction, and the block's grade clears your minimum, a BUY / SELL signal fires. One signal per bar, longs take priority.
— Trade construct. On a signal the engine builds an entry line at close, a stop a buffer beyond the zone edge (× ATR), and TP1 / TP2 at your chosen R multiples — drawn as green TARGET and red RISK zone boxes that extend, then freeze when SL or TP2 is touched.
▎ HOW TO USE IT
— Treat the surviving zones as decision areas, not guarantees. A blue zone is a bullish order block; a slate zone is bearish. The ★ tag shows its grade at a glance.
— Wait for price to return into a zone. The engine only signals on a retest + reaction, so you are not chasing the initial impulse.
— Use the BUY / SELL pill's grade (e.g. ★★★★ 7.8/10) as a confidence read — higher grades reflect stronger displacement, volume and candle body.
— The TARGET ZONE and RISK ZONE boxes frame reward against risk before you commit. Entry, SL, TP1 and TP2 are all labelled with their R multiples.
— Grey zones are spent — they have already been mitigated and are kept only as context for prior structure.
— Combine with your own higher-timeframe bias; order blocks aligned with trend tend to be the cleaner reactions.

▎ KEY SETTINGS
— Engine: ATR length, structure pivot width, displacement break multiple, OB candle search depth, and bull/bear toggles.
— Filters: volume expansion on/off with baseline length and multiplier, minimum grade required to signal, and confirm-on-close to avoid intrabar repaint.
— Zones: show zones, max zones kept (4-6 recommended), extension length, fill transparency, ★ grade labels, keep-mitigated-grey toggle, and bull/bear colours.
— Signals & Risk: show BUY/SELL pills, draw TP/SL zone, stop buffer (× ATR), TP1 and TP2 R multiples, projection length, and max trade sets kept.
— Extras: optional zone-reader candle tinting and an optional VWAP + σ band.
▎ DASHBOARD
A compact panel (five positions, three text sizes) reports: current Bias, count of live Bullish and Bearish OBs, the Nearest zone level and its distance in %, the Strongest zone's grade and tier, the Last Mitigated zone, the Active Signal state, and running Signal and Trade W/L tallies. The W/L count is an illustrative record of how the historical construct resolved — not a performance promise.
▎ ALERTS
— OB Bullish Signal — fires on a bullish order-block retest + reaction.
— OB Bearish Signal — fires on a bearish order-block retest + reaction.
Both include ticker and interval in the message.
▎ NOTES
— Works on all timeframes and all assets; ATR and volume baselines adapt automatically.
— Confirm On Bar Close evaluates detection, mitigation and signals on closed bars only, so confirmed signals do not repaint.
— Everything is toggleable — zones, grades, pills, trade boxes, candles, VWAP and dashboard — for a chart as clean or as detailed as you like.
— The volume filter self-disables on feeds without volume, so nothing breaks on those symbols.
For research and education only. This is not financial advice. No indicator can predict the future, and past behaviour never guarantees future results. Always do your own analysis and manage your own risk.
Made with passion by JackOfAllTrades ⚡
Most order-block tools paint a fresh box on every candle and bury the chart. This one does the opposite. It only marks the last opposing-close candle that appears just before a genuine displacement leg — a move that closes through a confirmed swing by more than a volatility-scaled threshold, backed by a volume expansion. The result: only a handful of clean, unmitigated, high-grade zones survive on screen at once.
▎ WHAT IT DOES
It maps institutional-style order blocks, grades each one from 0 to 10 by ★ quality, extends the surviving zones to the right until price mitigates them, and fires a single clean BUY / SELL pill on a valid retest + reaction — complete with an R-multiple TP/SL zone construct. A grey/white and blue-chrome dashboard keeps the running read of structure, bias and zone quality in one corner.
▎ HOW IT WORKS
— Confirmed swing structure. Pivot highs and lows are tracked with a configurable lookback. Each swing stays "unbroken" until price genuinely closes through it.
— Displacement break. A bullish break needs an up-close candle that closes above the last swing high by more than Displacement × ATR; a bearish break mirrors it below the swing low. ATR scaling means the threshold self-adjusts to any asset or timeframe.
— Volume confirmation. The breaking candle's volume must exceed its own moving-average baseline by the chosen multiplier. On symbols with no volume feed, this filter auto-skips.
— Order-block selection. Once a break is confirmed, the engine walks back through recent bars to find the last opposing-close candle — the down-close before a bullish break, or the up-close before a bearish break. That candle's high/low becomes the zone.
— ★ Grade (0-10). Each block is scored on three factors: how far the break displaced (in ATR), how strong the volume expansion was, and the body-to-range ratio of the origin candle. The composite maps to a 0-10 grade and a tier (WEAK → FAIR → SOLID → STRONG → ELITE).
— Mitigation & signals. Live zones extend right on each bar. If price closes fully through a zone, it is mitigated — frozen and greyed (or deleted). If instead price wicks back into the zone and the bar reacts back out with a close in the right direction, and the block's grade clears your minimum, a BUY / SELL signal fires. One signal per bar, longs take priority.
— Trade construct. On a signal the engine builds an entry line at close, a stop a buffer beyond the zone edge (× ATR), and TP1 / TP2 at your chosen R multiples — drawn as green TARGET and red RISK zone boxes that extend, then freeze when SL or TP2 is touched.
▎ HOW TO USE IT
— Treat the surviving zones as decision areas, not guarantees. A blue zone is a bullish order block; a slate zone is bearish. The ★ tag shows its grade at a glance.
— Wait for price to return into a zone. The engine only signals on a retest + reaction, so you are not chasing the initial impulse.
— Use the BUY / SELL pill's grade (e.g. ★★★★ 7.8/10) as a confidence read — higher grades reflect stronger displacement, volume and candle body.
— The TARGET ZONE and RISK ZONE boxes frame reward against risk before you commit. Entry, SL, TP1 and TP2 are all labelled with their R multiples.
— Grey zones are spent — they have already been mitigated and are kept only as context for prior structure.
— Combine with your own higher-timeframe bias; order blocks aligned with trend tend to be the cleaner reactions.
▎ KEY SETTINGS
— Engine: ATR length, structure pivot width, displacement break multiple, OB candle search depth, and bull/bear toggles.
— Filters: volume expansion on/off with baseline length and multiplier, minimum grade required to signal, and confirm-on-close to avoid intrabar repaint.
— Zones: show zones, max zones kept (4-6 recommended), extension length, fill transparency, ★ grade labels, keep-mitigated-grey toggle, and bull/bear colours.
— Signals & Risk: show BUY/SELL pills, draw TP/SL zone, stop buffer (× ATR), TP1 and TP2 R multiples, projection length, and max trade sets kept.
— Extras: optional zone-reader candle tinting and an optional VWAP + σ band.
▎ DASHBOARD
A compact panel (five positions, three text sizes) reports: current Bias, count of live Bullish and Bearish OBs, the Nearest zone level and its distance in %, the Strongest zone's grade and tier, the Last Mitigated zone, the Active Signal state, and running Signal and Trade W/L tallies. The W/L count is an illustrative record of how the historical construct resolved — not a performance promise.
▎ ALERTS
— OB Bullish Signal — fires on a bullish order-block retest + reaction.
— OB Bearish Signal — fires on a bearish order-block retest + reaction.
Both include ticker and interval in the message.
▎ NOTES
— Works on all timeframes and all assets; ATR and volume baselines adapt automatically.
— Confirm On Bar Close evaluates detection, mitigation and signals on closed bars only, so confirmed signals do not repaint.
— Everything is toggleable — zones, grades, pills, trade boxes, candles, VWAP and dashboard — for a chart as clean or as detailed as you like.
— The volume filter self-disables on feeds without volume, so nothing breaks on those symbols.
For research and education only. This is not financial advice. No indicator can predict the future, and past behaviour never guarantees future results. Always do your own analysis and manage your own risk.
Made with passion by JackOfAllTrades ⚡
Open-source script
In true PulseWire spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
The AI Trading Ecosystem, Built to win trades 📈
Get Full Access 👇
jackofalltrades.vip 🌐
🃏
Get Full Access 👇
jackofalltrades.vip 🌐
🃏
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by PulseWire. Read more in the Terms of Use.
Open-source script
In true PulseWire spirit, the creator of this script has made it open-source, so that traders can review and verify its functionality. Kudos to the author! While you can use it for free, remember that republishing the code is subject to our House Rules.
The AI Trading Ecosystem, Built to win trades 📈
Get Full Access 👇
jackofalltrades.vip 🌐
🃏
Get Full Access 👇
jackofalltrades.vip 🌐
🃏
Disclaimer
The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by PulseWire. Read more in the Terms of Use.
