OPEN-SOURCE SCRIPT

Long/Short Ratio [BigBeluga]

28 527
🔵 OVERVIEW
Long/Short Ratio [BigBeluga] is a lower-timeframe volume imbalance analyzer that estimates real-time buyer vs seller dominance inside each bar.
Instead of relying on exchange-reported positioning data, this indicator reconstructs directional pressure by aggregating volume from lower timeframes and separating it into buy-side and sell-side flow.

The result is a dynamic percentage-based long/short ratio that reflects immediate participation shifts and short-term positioning pressure.

🔵 CORE CONCEPT
  • Directional Volume Segmentation — Volume is classified as positive (buyers) when close > open, and negative (sellers) when close < open.
  • Lower-Timeframe Aggregation — The script pulls volume data from smaller internal timeframes and aggregates it into the current chart bar.
  • Buyer vs Seller Percentage — Total positive and negative volumes are converted into percentage ratios.
  • Momentum Shift Detection — A smoothed change of the ratio helps detect acceleration or deceleration in positioning pressure.


🔵 HOW IT WORKS
1️⃣ Lower-Timeframe Volume Sampling
  • The script automatically determines an internal lower timeframe based on the current chart timeframe.
  • Volume is requested using request.security_lower_tf().
    Pine Script®
  • This allows intra-bar analysis instead of using only finalized candle volume.


2️⃣ Buyer / Seller Calculation
  • If close > open → volume counts as buyer pressure.
  • If close < open → volume counts as seller pressure.
    快照
  • Buyer and seller totals are accumulated separately.
  • Percentages are calculated:
    • Buy % = Buyers / Total Volume
    • Sell % = Sellers / Total Volume


3️⃣ Ratio Visualization
  • Long (Buy %) plotted as teal columns.
  • Short (Sell %) plotted as maroon columns.
    快照
  • 50% midline represents balance between buyers and sellers.
  • A stepline tracks the Buy % ratio for clarity.
    快照


4️⃣ Smoothed Ratio Momentum
  • The indicator calculates a smoothed HMA of the user-defined change in Buy %.
  • This produces a momentum curve showing acceleration in dominance.
  • Color logic:
    • Teal → Increasing long pressure
    • Maroon → Increasing short pressure

    快照
  • A dynamic midline (average of recent values) provides equilibrium reference.


5️⃣ Main Chart Dashboard
  • A dedicated heads-up display (HUD) is anchored to the top-right of your main price chart (via force_overlay).
  • This table provides the exact real-time Buy/Sell percentages of the current candle at a glance.
  • Provides instant clarity without having to look down at the indicator pane.
    快照


6️⃣ Extreme Sentiment Signals
  • Visual plotshape icons appear directly on the main chart when sentiment hits user-defined extreme thresholds.
  • Extreme Buy: A triangle appears at the bottom of the price chart when buyers exceed the limit (default 80%).
  • Extreme Sell: A triangle appears at the top of the price chart when sellers exceed the limit (default 80%).
  • These markers help identify potential reversal points or "exhaustion" spikes.
    快照


🔵 KEY FEATURES
  • Lower-timeframe volume reconstruction.
  • Real-time Buy vs Sell percentage display.
  • Main chart dashboard for immediate data access.
  • Adjustable Extreme Sentiment markers and thresholds.
  • Customizable colors and smoothing periods for the momentum curve.
  • Clear 50% equilibrium reference line.
  • Dynamic long/short stepline.
  • Automatic timeframe adaptation.
  • Visual Buy / Sell labels with live percentage updates.


🔵 HOW TO USE
  • Above 50% Buy → Long pressure dominance.
    快照
  • Below 50% Buy → Short pressure dominance.
    快照
  • Watch for strong divergence between price and ratio.
  • Use the smoothed ratio curve to detect acceleration in positioning.
  • Extreme spikes (marked by triangles) can indicate exhaustion or breakout fuel.
  • Best used on 5-minute and higher timeframes for reliable aggregation.


🔵 INTERPRETING POSITIONING
  • Rising price + rising Buy % → Confirmed bullish participation.
    快照
  • Rising price + falling Buy % → Weak trend / potential divergence.
    快照
  • Falling price + rising Buy % → Absorption.
    快照
  • Extreme imbalance → Potential short squeeze or long squeeze setup.


🔵 CONCLUSION
Long/Short Ratio [BigBeluga] provides a clean, data-driven view of intrabar participation pressure without relying on external exchange positioning feeds.

By combining lower-timeframe aggregation, percentage imbalance, and smoothed momentum detection—now enhanced with a main chart dashboard and extreme signal icons—it offers a practical tool for spotting positioning shifts, divergence, and participation-driven breakouts.

免责声明

这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。