PROTECTED SOURCE SCRIPT
BK AK-Flag Formations

🏴☠️ BK AK-Flag Formations — Flags & Pennants, Tactical Continuations 🏴☠️
BK AK-Flag Formations automatically scans price for Flag + Pennant continuation structures using a validated pattern engine (Trendoscope), then adds a tactical layer for clean labels, hover intel, filtered alerts, pole-based targets, trap markers, and forward structure planning.
🧾 Full Credit — Foundation Engine (Trendoscope)
The underlying detection architecture (zigzag scanning, pivots, validation, classification, overlap handling, drawing framework) is by Trendoscope via imported libraries.
This publication keeps that engine intact and adds an execution-oriented interface layer: labels, alerts, targets, trap logic, MTF context, and usability.
✅ What This Indicator Draws
It detects and draws these continuation formations on your chart:
Flags
BF — Bull Flag
BeF — Bear Flag
Pennants
BP — Bull Pennant
BeP — Bear Pennant
Labels can be short tags (BF / BP / BeF / BeP) to stay readable, while tooltips can show the full context on hover.
🔍 How Detection Works (So You Know It’s Not Random)
This script uses Trendoscope’s chart pattern engine to validate structure before anything is drawn:
Multi-Zigzag Scan (4 sensitivities)
Runs multiple Zigzag Length/Depth pairs so it can detect flags/pennants across different swing scales (micro → macro).
Trendline Fit Validation
Error Threshold controls how much deviation is allowed from ideal lines.
Flat Threshold controls what qualifies as “flat” vs “sloping” behavior in boundaries.
Flag Quality Filter (Retracement Control)
Max Retracement (flagRatio) limits how deep the consolidation retraces vs the impulse (keeps it a continuation structure).
Overlap + Structure Hygiene
Avoid Overlap reduces stacked/noisy patterns.
Max Patterns caps what remains on chart for clarity.
🧩 BK Enhancements (Why This Version Exists)
These are the layers added on top of the base detection engine:
🧠 Warfare Intel Tooltips (Optional)
Hover a pattern label to see:
⚔️ Strategy (what the structure usually means)
📊 Battlefield (ATR/volume regime, session context, RSI, EMA trend)
🎯 Next Move (plan layout using ATR + pole targets)
📖 Intel (education + confirmation notes)
⚡ Strength Score (1–10)
Each pattern can be scored using weighted factors:
consolidation duration
volume trend
ATR compression
session quality
flag tightness (flag body vs pole size)
Optional ⚡ badge appears on the label when enabled.
📐 Pole-Based Measured Moves (Institutional Method)
Targets are projected using pole height (impulse leg before the flag/pennant):
Default levels: 0.618 / 1.0 / 1.618 × pole
Optional target labels + adjustable extension bars
🪤 False Break / Trap Detection
Marks situations where price breaks a boundary then closes back inside (common continuation traps / reversal entries depending on context).
⏳ Pattern Aging
Older patterns fade in importance visually (predictive value decays over time).
🔥 Breakout Decision Zone (Pennants)
Shades a “decision zone” near the pennant apex where resolution is most likely.
➡️ Border Extension
Extends only the relevant boundary lines forward by N bars for planning breaks/retests.
⚙️ Key Inputs You’ll Actually Tune
Zigzag Length/Depth: swing sensitivity (more sensitive = more patterns)
Error / Flat Thresholds: strictness of geometry validation
Max Retracement (flagRatio): how deep the flag body can retrace
Avoid Overlap + Max Patterns: reduce clutter
Measured Moves / Trap Detection / Tooltips: enable as needed
🚩 Alerts (Filtered, Not Spam)
Alerts can be routed by:
Bias: Bullish / Bearish / Neutral
Type: Flag / Pennant
Alerts fire when a valid pattern is confirmed by the engine.
👑 King Solomon Lens
“The prudent sees danger and hides himself, but the simple go on and suffer for it.” — Proverbs 22:3
Flags and pennants are continuation setups, but wisdom waits for confirmation—especially around false breaks.
BK AK-Flag Formations automatically scans price for Flag + Pennant continuation structures using a validated pattern engine (Trendoscope), then adds a tactical layer for clean labels, hover intel, filtered alerts, pole-based targets, trap markers, and forward structure planning.
🧾 Full Credit — Foundation Engine (Trendoscope)
The underlying detection architecture (zigzag scanning, pivots, validation, classification, overlap handling, drawing framework) is by Trendoscope via imported libraries.
This publication keeps that engine intact and adds an execution-oriented interface layer: labels, alerts, targets, trap logic, MTF context, and usability.
✅ What This Indicator Draws
It detects and draws these continuation formations on your chart:
Flags
BF — Bull Flag
BeF — Bear Flag
Pennants
BP — Bull Pennant
BeP — Bear Pennant
Labels can be short tags (BF / BP / BeF / BeP) to stay readable, while tooltips can show the full context on hover.
🔍 How Detection Works (So You Know It’s Not Random)
This script uses Trendoscope’s chart pattern engine to validate structure before anything is drawn:
Multi-Zigzag Scan (4 sensitivities)
Runs multiple Zigzag Length/Depth pairs so it can detect flags/pennants across different swing scales (micro → macro).
Trendline Fit Validation
Error Threshold controls how much deviation is allowed from ideal lines.
Flat Threshold controls what qualifies as “flat” vs “sloping” behavior in boundaries.
Flag Quality Filter (Retracement Control)
Max Retracement (flagRatio) limits how deep the consolidation retraces vs the impulse (keeps it a continuation structure).
Overlap + Structure Hygiene
Avoid Overlap reduces stacked/noisy patterns.
Max Patterns caps what remains on chart for clarity.
🧩 BK Enhancements (Why This Version Exists)
These are the layers added on top of the base detection engine:
🧠 Warfare Intel Tooltips (Optional)
Hover a pattern label to see:
⚔️ Strategy (what the structure usually means)
📊 Battlefield (ATR/volume regime, session context, RSI, EMA trend)
🎯 Next Move (plan layout using ATR + pole targets)
📖 Intel (education + confirmation notes)
⚡ Strength Score (1–10)
Each pattern can be scored using weighted factors:
consolidation duration
volume trend
ATR compression
session quality
flag tightness (flag body vs pole size)
Optional ⚡ badge appears on the label when enabled.
📐 Pole-Based Measured Moves (Institutional Method)
Targets are projected using pole height (impulse leg before the flag/pennant):
Default levels: 0.618 / 1.0 / 1.618 × pole
Optional target labels + adjustable extension bars
🪤 False Break / Trap Detection
Marks situations where price breaks a boundary then closes back inside (common continuation traps / reversal entries depending on context).
⏳ Pattern Aging
Older patterns fade in importance visually (predictive value decays over time).
🔥 Breakout Decision Zone (Pennants)
Shades a “decision zone” near the pennant apex where resolution is most likely.
➡️ Border Extension
Extends only the relevant boundary lines forward by N bars for planning breaks/retests.
⚙️ Key Inputs You’ll Actually Tune
Zigzag Length/Depth: swing sensitivity (more sensitive = more patterns)
Error / Flat Thresholds: strictness of geometry validation
Max Retracement (flagRatio): how deep the flag body can retrace
Avoid Overlap + Max Patterns: reduce clutter
Measured Moves / Trap Detection / Tooltips: enable as needed
🚩 Alerts (Filtered, Not Spam)
Alerts can be routed by:
Bias: Bullish / Bearish / Neutral
Type: Flag / Pennant
Alerts fire when a valid pattern is confirmed by the engine.
👑 King Solomon Lens
“The prudent sees danger and hides himself, but the simple go on and suffer for it.” — Proverbs 22:3
Flags and pennants are continuation setups, but wisdom waits for confirmation—especially around false breaks.
Script protégé
Ce script est publié en source fermée. Cependant, vous pouvez l'utiliser librement et sans aucune restriction – pour en savoir plus, cliquez ici.
Clause de non-responsabilité
Les informations et publications ne sont pas destinées à être, et ne constituent pas, des conseils ou recommandations financiers, d'investissement, de trading ou autres fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.
Script protégé
Ce script est publié en source fermée. Cependant, vous pouvez l'utiliser librement et sans aucune restriction – pour en savoir plus, cliquez ici.
Clause de non-responsabilité
Les informations et publications ne sont pas destinées à être, et ne constituent pas, des conseils ou recommandations financiers, d'investissement, de trading ou autres fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.