OPEN-SOURCE SCRIPT
Bookmap Traps

Overview
This indicator utilizes the request.footprint() function to analyze sub-bar order flow and identify where large participants are "trapped" or "underwater." By aggregating tick-level volume and identifying imbalances at the edges of candles (wicks), it highlights high-probability reversal zones and exhaustion points.
Note
This is an upgrade version of my Bookmap Footprint Imbalance Bubbles indicator, check my profile to check it out. Footprint data on tradingview is also inaccurate after a certain cutoff, it is different for every ticker. Reduce the max lookback bars to ignore that data.
How it Works
The script calculates the delta and volume for every price level within a bar. It specifically looks for "Aggregated Traps"—clusters of buy or sell imbalances that occur at prices the market has since moved away from.
Key Features
Settings Guide
This indicator utilizes the request.footprint() function to analyze sub-bar order flow and identify where large participants are "trapped" or "underwater." By aggregating tick-level volume and identifying imbalances at the edges of candles (wicks), it highlights high-probability reversal zones and exhaustion points.
Note
This is an upgrade version of my Bookmap Footprint Imbalance Bubbles indicator, check my profile to check it out. Footprint data on tradingview is also inaccurate after a certain cutoff, it is different for every ticker. Reduce the max lookback bars to ignore that data.
How it Works
The script calculates the delta and volume for every price level within a bar. It specifically looks for "Aggregated Traps"—clusters of buy or sell imbalances that occur at prices the market has since moved away from.
- Trapped Buyers: Occur when significant buy imbalances are found at the top of a candle, but the price closes lower.
- Trapped Sellers: Occur when significant sell imbalances are found at the bottom of a candle, but the price closes higher.
Key Features
- Aggregated Cluster Logic: Instead of cluttering your chart with every single imbalance, this script sums up the trapped volume across the entire bar to provide a single, weighted "Bubble" at the average price of the trap.
- Top % Filter: A unique feature that allows you to filter for only the most significant events. Setting this to 10% will hide all but the top 10% largest volume traps currently on your chart.
- Dynamic Scaling: Choose between Size Scaling (larger bubbles for more volume) or Transparency Scaling (more opaque bubbles for higher conviction).
- Strict Wick Mode: When enabled, the script only considers traps occurring in the outer 30% of the candle (the wicks), ensuring you are only seeing true exhaustion.
- Auto-Scale Percentile Logic: The indicator automatically identifies "Outliers" based on chart history, ensuring the bubbles remain visually relevant regardless of the asset's typical volume.
Settings Guide
- Ticks per Row: Consolidates price levels. Use 1 for precision (e.g., Forex/Indices) or higher numbers for high-priced stocks/crypto.
- Imbalance Ratio: The multiplier required to trigger a trap (e.g., 3.0 means buyers must be 3x stronger than sellers).
- Show Top % of Traps: The ultimate filter. Reduce this to 5% or 10% to see only the "Whale" activity.
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。