PROTECTED SOURCE SCRIPT
YBL – Order Flow Bubbles + Alerts (Imbalance, Anchored)

YBL – Order Flow Bubbles + Alerts (Imbalance, Anchored)
This tool plots order-flow aggression bubbles directly on the price chart, using a z-score of candle delta (body × volume) plus a volume filter. The idea is to highlight bars where buying or selling aggression is significantly stronger than normal and to anchor that information at meaningful price levels.
⸻
🔧 Core logic
• Delta per bar
• delta = (close – open) × volume
• Positive delta → buy aggression (buyers lifting offers).
• Negative delta → sell aggression (sellers hitting bids).
• Z-score imbalance
• Uses lenDelta as the lookback window for:
• Average delta
• Standard deviation of delta
• Average volume
• A bar is considered strongly imbalanced when:
• |deltaZ| ≥ zTrigger, and
• Volume is at least minVolMul × average volume.
• Volume scaling → bubble size
• Bubble size is derived from the ratio volume / average volume:
• Small → Huge, based on how large the spike is compared to normal volume.
⸻
🎯 Bubble placement & visuals
• Color
• Lime bubble = strong buy bar.
• Red bubble = strong sell bar.
• Label text (optional)
• You can display the delta value in “K” inside the bubble (e.g. +350.0K).
• Anchoring
• Two anchor modes:
• “Extremos (Hi/Lo)” → bubble anchored near high or low of the candle, offset by ATR.
• “Centro (Mid)” → bubble anchored at the midpoint between high and low.
• ATR offset
• Uses ATR × atrMul to push the bubble slightly away from the extreme, so it doesn’t overlap the wick or other drawings.
• Soft background shading
• When a strong buy bar is detected → light green background.
• When a strong sell bar is detected → light red background.
This makes high-pressure zones easy to see when scrolling quickly.
⸻
🔔 Alerts
Two built-in alert conditions:
• BUY Aggression Bubble
Triggered when a strong bullish imbalance appears (green bubble).
• SELL Aggression Bubble
Triggered when a strong bearish imbalance appears (red bubble).
The alert messages include ticker, timeframe and close price so they can be used for automated notifications or as part of a trading workflow.
⸻
📈 Typical use
• Spot aggressive entry points where institutional players are likely hitting bids/offers.
• Mark key reaction levels (high/low or mid of the bubble candle) to watch for future retests.
• Combine with CVD / Smart Money Volume / institutional levels as extra confluence for entries, scalps or reversals.
⸻
⚠️ Disclaimer
This script is for educational and analytical purposes only. It is not financial advice. Always do your own research and manage your risk.
This tool plots order-flow aggression bubbles directly on the price chart, using a z-score of candle delta (body × volume) plus a volume filter. The idea is to highlight bars where buying or selling aggression is significantly stronger than normal and to anchor that information at meaningful price levels.
⸻
🔧 Core logic
• Delta per bar
• delta = (close – open) × volume
• Positive delta → buy aggression (buyers lifting offers).
• Negative delta → sell aggression (sellers hitting bids).
• Z-score imbalance
• Uses lenDelta as the lookback window for:
• Average delta
• Standard deviation of delta
• Average volume
• A bar is considered strongly imbalanced when:
• |deltaZ| ≥ zTrigger, and
• Volume is at least minVolMul × average volume.
• Volume scaling → bubble size
• Bubble size is derived from the ratio volume / average volume:
• Small → Huge, based on how large the spike is compared to normal volume.
⸻
🎯 Bubble placement & visuals
• Color
• Lime bubble = strong buy bar.
• Red bubble = strong sell bar.
• Label text (optional)
• You can display the delta value in “K” inside the bubble (e.g. +350.0K).
• Anchoring
• Two anchor modes:
• “Extremos (Hi/Lo)” → bubble anchored near high or low of the candle, offset by ATR.
• “Centro (Mid)” → bubble anchored at the midpoint between high and low.
• ATR offset
• Uses ATR × atrMul to push the bubble slightly away from the extreme, so it doesn’t overlap the wick or other drawings.
• Soft background shading
• When a strong buy bar is detected → light green background.
• When a strong sell bar is detected → light red background.
This makes high-pressure zones easy to see when scrolling quickly.
⸻
🔔 Alerts
Two built-in alert conditions:
• BUY Aggression Bubble
Triggered when a strong bullish imbalance appears (green bubble).
• SELL Aggression Bubble
Triggered when a strong bearish imbalance appears (red bubble).
The alert messages include ticker, timeframe and close price so they can be used for automated notifications or as part of a trading workflow.
⸻
📈 Typical use
• Spot aggressive entry points where institutional players are likely hitting bids/offers.
• Mark key reaction levels (high/low or mid of the bubble candle) to watch for future retests.
• Combine with CVD / Smart Money Volume / institutional levels as extra confluence for entries, scalps or reversals.
⸻
⚠️ Disclaimer
This script is for educational and analytical purposes only. It is not financial advice. Always do your own research and manage your risk.
สคริปต์ที่ได้รับการป้องกัน
สคริปต์นี้ถูกเผยแพร่เป็นแบบ closed-source อย่างไรก็ตาม คุณสามารถใช้ได้อย่างอิสระและไม่มีข้อจำกัดใดๆ – เรียนรู้เพิ่มเติมได้ที่นี่
คำจำกัดสิทธิ์ความรับผิดชอบ
ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมใน ข้อกำหนดการใช้งาน
สคริปต์ที่ได้รับการป้องกัน
สคริปต์นี้ถูกเผยแพร่เป็นแบบ closed-source อย่างไรก็ตาม คุณสามารถใช้ได้อย่างอิสระและไม่มีข้อจำกัดใดๆ – เรียนรู้เพิ่มเติมได้ที่นี่
คำจำกัดสิทธิ์ความรับผิดชอบ
ข้อมูลและบทความไม่ได้มีวัตถุประสงค์เพื่อก่อให้เกิดกิจกรรมทางการเงิน, การลงทุน, การซื้อขาย, ข้อเสนอแนะ หรือคำแนะนำประเภทอื่น ๆ ที่ให้หรือรับรองโดย TradingView อ่านเพิ่มเติมใน ข้อกำหนดการใช้งาน