OPEN-SOURCE SCRIPT
Execution Heatmap v4.1 — AI Enhanced

This indicator is an AI‑style execution dashboard that compresses structure, momentum, volume, volatility, and risk into a compact heatmap panel plus BUY/SELL signals on the chart. It is specifically tuned for gold and silver, automatically adapting its thresholds to the volatility profile of XAU/GC and XAG/SI symbols.
Core architecture
The system builds a multi‑factor model in layers:
Adaptive structure engine: Tracks dynamic higher‑high / lower‑low progression using rolling reference highs and lows, classifying price as structural UP, DOWN, or NEUTRAL.
Precision VWAP bias: Uses VWAP with a small threshold band to filter out noise and label price as ABOVE, BELOW, or neutral relative to value.
Impulse & angle: Combines short‑term rate of change and normalized slope (price vs ATR over 5 bars) to detect directional thrust, then clamps values into
[
−
1
,
1
]
[−1,1] for stable scoring.
Volume, wicks, and patterns
Adaptive volume tiers: Uses a 20‑bar volume average with gold/silver‑specific multipliers to tag candles as SURGE, HIGH, NORMAL, or LOW volume, with distinct coloring for extremes.
Wick analytics: Measures upper/lower wick size vs total range to detect demand/supply style rejections and encode them as bullish or bearish wick signals.
AI pattern score: Blends structure, VWAP, impulse, wicks, and angle into a normalized pattern score, then classifies it as STRONG↑, NEU↑, NEU, NEU↓, or STRONG↓ with color‑coded emphasis.
AI scoring and prediction layer
Predictive engine: Uses a neural‑network‑style weighted sum of structure, VWAP, impulse, wicks, angle, volume, and pattern to generate a prediction score in
[−1,1], then converts it into a percentage and arrow (↑, ↑↑, ↓, ↓↓, →) for intuitive directional bias.
Execution score: Aggregates key factors into an EXEC score (0–200+ style scale), color‑graded from weak (red) through medium (orange) to strong (green) execution context.
Uncertainty & risk: Separately models uncertainty (low impulse/angle or low conviction) and risk (fake breaks, VWAP position, uncertainty tier, low volume), then feeds them into a combined confidence calculation.
Final signal & confidence
Final classification:
BUY: High exec score, high confidence, and controlled risk.
SELL: Very low exec score, low confidence in upside, and acceptable risk.
WAIT: All other conditions where edge or clarity is insufficient.
Confidence bar: A textual mini‑bar (🟩 blocks) plus percentage shows how strong the current signal environment is, making it easy to visually gauge setup quality at a glance.
Professional heatmap panel
A two‑column table in the top‑right of the chart organizes the logic into layers:
Base layer: STRUCT, VWAP, IMPULSE, VOLUME.
AI layer: FAKE, REGIME (Trend/Pullback/Reverse/Chop), ANGLE.
Decision layer: PATTERN, PREDICT, EXEC, RISK, CONF, and FINAL direction.
Core architecture
The system builds a multi‑factor model in layers:
Adaptive structure engine: Tracks dynamic higher‑high / lower‑low progression using rolling reference highs and lows, classifying price as structural UP, DOWN, or NEUTRAL.
Precision VWAP bias: Uses VWAP with a small threshold band to filter out noise and label price as ABOVE, BELOW, or neutral relative to value.
Impulse & angle: Combines short‑term rate of change and normalized slope (price vs ATR over 5 bars) to detect directional thrust, then clamps values into
[
−
1
,
1
]
[−1,1] for stable scoring.
Volume, wicks, and patterns
Adaptive volume tiers: Uses a 20‑bar volume average with gold/silver‑specific multipliers to tag candles as SURGE, HIGH, NORMAL, or LOW volume, with distinct coloring for extremes.
Wick analytics: Measures upper/lower wick size vs total range to detect demand/supply style rejections and encode them as bullish or bearish wick signals.
AI pattern score: Blends structure, VWAP, impulse, wicks, and angle into a normalized pattern score, then classifies it as STRONG↑, NEU↑, NEU, NEU↓, or STRONG↓ with color‑coded emphasis.
AI scoring and prediction layer
Predictive engine: Uses a neural‑network‑style weighted sum of structure, VWAP, impulse, wicks, angle, volume, and pattern to generate a prediction score in
[−1,1], then converts it into a percentage and arrow (↑, ↑↑, ↓, ↓↓, →) for intuitive directional bias.
Execution score: Aggregates key factors into an EXEC score (0–200+ style scale), color‑graded from weak (red) through medium (orange) to strong (green) execution context.
Uncertainty & risk: Separately models uncertainty (low impulse/angle or low conviction) and risk (fake breaks, VWAP position, uncertainty tier, low volume), then feeds them into a combined confidence calculation.
Final signal & confidence
Final classification:
BUY: High exec score, high confidence, and controlled risk.
SELL: Very low exec score, low confidence in upside, and acceptable risk.
WAIT: All other conditions where edge or clarity is insufficient.
Confidence bar: A textual mini‑bar (🟩 blocks) plus percentage shows how strong the current signal environment is, making it easy to visually gauge setup quality at a glance.
Professional heatmap panel
A two‑column table in the top‑right of the chart organizes the logic into layers:
Base layer: STRUCT, VWAP, IMPULSE, VOLUME.
AI layer: FAKE, REGIME (Trend/Pullback/Reverse/Chop), ANGLE.
Decision layer: PATTERN, PREDICT, EXEC, RISK, CONF, and FINAL direction.
สคริปต์โอเพนซอร์ซ
ด้วยเจตนารมณ์หลักของ TradingView ผู้สร้างสคริปต์นี้ได้ทำให้เป็นโอเพนซอร์ส เพื่อให้เทรดเดอร์สามารถตรวจสอบและยืนยันฟังก์ชันการทำงานของมันได้ ขอชื่นชมผู้เขียน! แม้ว่าคุณจะใช้งานได้ฟรี แต่โปรดจำไว้ว่าการเผยแพร่โค้ดซ้ำจะต้องเป็นไปตาม กฎระเบียบการใช้งาน ของเรา
คำจำกัดสิทธิ์ความรับผิดชอบ
ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมใน ข้อกำหนดการใช้งาน
สคริปต์โอเพนซอร์ซ
ด้วยเจตนารมณ์หลักของ TradingView ผู้สร้างสคริปต์นี้ได้ทำให้เป็นโอเพนซอร์ส เพื่อให้เทรดเดอร์สามารถตรวจสอบและยืนยันฟังก์ชันการทำงานของมันได้ ขอชื่นชมผู้เขียน! แม้ว่าคุณจะใช้งานได้ฟรี แต่โปรดจำไว้ว่าการเผยแพร่โค้ดซ้ำจะต้องเป็นไปตาม กฎระเบียบการใช้งาน ของเรา
คำจำกัดสิทธิ์ความรับผิดชอบ
ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมใน ข้อกำหนดการใช้งาน