OPEN-SOURCE SCRIPT
Updated

BK AK-King Quazi

5 272
👑 BK AK–King Quazi — Quasimodo State Machine + Projections + MTF Table 👑

🙏 All glory to G-d.
Built with standards and discipline passed down by my mentor — thank you for the relentless insistence on structure over noise, and for sharing real knowledge with generosity — no gatekeeping, no cheapness, no games.

Update / Record

A previous version of this publication was hidden due to insufficient description. This republish is a complete, self-contained explanation of what the script does, how it works, how to use it, and its limitations.

What this script does

King Quazi is a Quasimodo structure detector that turns the classic institutional sequence into a state machine:

Sweep → BOS (Break of Structure) → Retest (QM hold) → Confirm (Full QM)
…and it automatically builds:

QM / BOS / INV projection levels

optional Entry Zone buffer

optional T1 / T2 targets

invalidation / target-hit resolution

a Multi-Timeframe (MTF) table that tracks Quazi stages across up to 5 timeframes

It’s designed to stop you from guessing mid-range and force price to prove itself at the boundary.

Core logic (how it detects Quazi)

King Quazi uses a swing engine (ZigZag-like) built from rolling highs/lows over a configurable length (“ZZ length”). From those swings it evaluates two main structures:

1) PROTO (P) — Sweep + BOS (entry setup begins)

A PROTO event triggers when the script detects:

a liquidity sweep (stop run / fake-out behavior)

followed by a BOS in the opposite direction

with an optional displacement filter (candle body size in ATR terms)

Bull PROTO (P↑) = sweep down + BOS up
Bear PROTO (P↓) = sweep up + BOS down

When PROTO fires, the script stores fixed levels:

QM level (the key retest level)

BOS level (structure break)

INV level (where the thesis dies)

2) RETEST (R) — QM hold (execution zone)

After PROTO, a “RETEST” is flagged when price returns to QM and holds the correct side (touch + close logic). This is treated as the execution zone in the workflow.

3) CONFIRM (C) — Full Quasimodo completion

Confirm requires the fuller QM structure conditions to be met (the “pattern proved itself” state). This is the highest-confidence stage this tool prints.

4) INVALIDATION (X)

If price breaks the stored INV level before targets are resolved, the pattern is invalidated:

labels can switch from C/P to X

projections can be deleted OR “deadified” (grayed/dotted) depending on settings

What it draws on chart
A) Event labels

P↑ / P↓ = PROTO triggered

R↑ / R↓ = Retest detected

C↑ / C↓ = Confirm printed

X = invalidated

✓ = target hit (optional)

Label count is capped via a queue so the chart doesn’t explode.

B) Projection system (optional)

When PROTO triggers, the script can plot horizontal projection levels:

QM

BOS

INV

optional T1 / T2

optional Entry Zone (ATR buffer around QM)

You can choose:

how long projections extend (bars)

styles/widths “by meaning” (QM/BOS/INV/T targets) or unified

whether to keep projections after invalidation (turn gray) or remove them

C) Target models (optional)

Targets can be:

BOS + Prior Swing

Measured move (T1=1.0, T2=1.618 multipliers)

Neck→Head projection (H&S-style distance projection)

D) Resolution rules (optional)

You can automatically resolve the pattern when:

T1 hit or T2 hit
…and optionally remove projections/tags on resolution.

E) “Opposite PROTO” handling

If a new PROTO appears in the opposite direction while one is active, you can:

do nothing

clear projections

mark X + clear (kills the prior thesis cleanly)

Institutional tooltips (what the hover system includes)

If enabled, tooltips can include:

live distances from price to QM/BOS/INV/T1/T2

risk sizing and R:R estimates

“what now” execution guidance based on stage (P/R/C/X/HIT)

auction / trap logic text (liquidity magnets, stop pools)

optional Gann Square of 9 harmonic levels from the QM pivot

a blended EV readout (simple heuristic)

You can toggle tooltip modules (education / execution / checklist / Gann / auction / what-now / risk).

MTF BOOM Table (multi-timeframe context)

The script can scan up to 5 user-defined timeframes and display:

STATE: active stage (P↑, C↑, P↓, C↓, or neutral)

NOW: whether a PROTO/CONFIRM event happened within the last N bars (flash window)

It also computes a simple alignment count:

how many TFs are bull-staged vs bear-staged

and highlights when 3+ timeframes agree (higher conviction, less chop)

Optional alert() notifications can fire on:

PROTO bull/bear per TF

CONFIRM bull/bear per TF

How to use (practical workflow)

Start with MTF: don’t fight stacked alignment.

Wait for PROTO (P) — it defines the thesis and the levels.

Treat RETEST (R) as the preferred execution zone (QM hold).

Use CONFIRM (C) as “pattern proved itself” (add/hold/late entry logic).

INV is your line in the sand (the thesis dies there).

Manage to T1/T2 using your chosen target model and resolution settings.

Repaint / reliability notes (important)

Swing engine is dynamic: because swings are derived from rolling highs/lows, the identity of “recent swing points” can shift while structure is forming.

After a PROTO triggers, the script stores QM/BOS/INV as fixed values for that pattern, which greatly reduces “moving targets” after the event.

MTF table uses request.security(..., lookahead_off), but values on a higher timeframe can still update while that HTF candle is building. For strict confirmation, treat MTF “NOW” as most reliable on timeframe bar close.

Performance / limits

This script draws labels/lines/boxes and limits total objects with caps:

max labels / max lines

projection extension length

confirm-path limit (can clutter)

If you want a cleaner chart, disable confirm paths and/or reduce projection features.

Disclaimer

This indicator is for educational and analytical purposes only. It is not financial advice and does not guarantee outcomes. All “institutional” language refers to pattern logic and contextual heuristics, not certainty.

🙏 All glory to G-d — may He bless your discipline, patience, and execution.
Release Notes
👑 BK AK–King Quazi — Quasimodo State Machine + Projections + MTF Table 👑
🙏 All glory to G-d.

Update / Record

Moderators requested a more detailed explanation of this script. This description explains what it does, how it works, how to use it, and limitations.

Why this is original / not a mashup

King Quazi is one integrated system: a Quasimodo (QM) state machine. Every feature (projections, targets, invalidations, tooltips, MTF table, alerts) is driven by the same stored pattern levels — not a bundle of unrelated indicators.

What it does

Detects and manages the institutional QM sequence as states:
Sweep → BOS → Retest → Confirm
When a PROTO triggers, it locks the key levels and can plot them forward:

QM (retest / execution boundary)

BOS (break of structure / commitment)

INV (invalidation / thesis death)
Optional: Entry Zone (ATR buffer), T1/T2 targets, auto-resolution on target hit, and “deadified” projections on invalidation.

How it works (core logic)

Uses a ZigZag-like swing engine (rolling highs/lows over “ZZ length”).

PROTO (P↑/P↓) fires on a liquidity sweep followed by a BOS in the opposite direction, filtered by an ATR-based displacement threshold.

RETEST (R↑/R↓) prints when price returns to QM and holds the correct side (touch + close logic).

CONFIRM (C↑/C↓) requires the fuller QM structure conditions (pattern proven).

INVALIDATION (X) occurs if price breaks INV before resolution (remove or gray/dot projections).

Targets (optional)

Choose one:

BOS + prior swing

Measured move (1.0 / 1.618)

Neck→Head projection
Optional: resolve/clear drawings when T1 or T2 is hit (✓ labels optional).

MTF “BOOM” Table (optional)

Scans up to 5 timeframes with request.security(..., lookahead_off) and shows:

STATE (P↑/C↑/P↓/C↓/neutral)

NOW (events within last N bars)
Also counts alignment (e.g., 3+ TFs agree = higher conviction). Optional alerts on PROTO/CONFIRM per TF.

How to use (simple workflow)

Start with MTF alignment (don’t fight stacked direction).

Wait for PROTO (P) to define the thesis + levels.

Treat RETEST (R) as preferred execution zone (QM hold).

INV is the line in the sand (thesis dies there).

Manage to T1/T2 if enabled.

If opposite PROTO prints, optionally Mark X + Clear to kill the old thesis.

Reliability / repaint notes

Swing points can shift while forming (dynamic swing engine).

After PROTO, QM/BOS/INV are stored as fixed values for that pattern.

HTF table values can update while the HTF candle is still building; “NOW” is most reliable on HTF close.

Performance

Uses drawing objects (labels/lines/boxes). Reduce projection features, extension length, and confirm paths for cleaner charts.

Disclaimer: Educational/analytical only. Not financial advice.

🙏 All glory to G-d — may He bless your discipline, patience, and execution.

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 TradingView. Read more in the Terms of Use.