OPEN-SOURCE SCRIPT
Long/Short Ratio Aggregated (Lite)

Description — Long/Short Ratio Aggregated (Lite)
This indicator provides a cross-exchange, open-interest-weighted aggregation of the Long/Short Ratio (LSR) for the cryptocurrency asset currently on your chart. It is designed to unify fragmented derivatives positioning data from multiple major exchanges into a single normalized signal that more accurately reflects real market sentiment and positioning bias across platforms.
Concept and Originality
Traditional Long/Short Ratio indicators are exchange-specific. They show how many traders are long versus short, but only within the scope of one venue (e.g., Binance or Bybit). This makes them incomplete and often misleading for directional bias analysis, since different exchanges host different participant profiles, levels of leverage, and quote-currency exposures.
This script addresses that limitation by:
Aggregating LSR data across multiple exchanges (Binance and Bybit).
Weighting each ratio by Open Interest (OI) — ensuring exchanges with higher open positions contribute proportionally more to the overall sentiment.
Normalizing all contract types (USDT, USDC, and USD-margined) into a consistent base-currency format.
This step corrects for structural differences between coin- and stablecoin-margined instruments, producing a true like-for-like comparison.
The result is a globalized Long/Short Ratio, normalized by exposure and liquidity, suitable for multi-venue orderflow estimation and directional bias assessment.
Note for moderators: I know there are already other scripts out there, but they may not support Open Interest Weighting or the same number of pairs. They also might not support proper normalization like in my script.
Calculation Methodology
For each supported exchange and contract type:
The script retrieves the latest Long/Short Ratio (LSR) and Open Interest (OI) values.
OI is used as the weighting factor, creating a proportional representation of positioning volume.
Values denominated in USD are normalized into base currency using close-price adjustment.
The final value is computed as:
Weighted LSR = (Σ (LSRᵢ × OIᵢ)) / (Σ OIᵢ)
This ensures that if, for example, Binance has twice the open interest of Bybit, its LSR contributes twice as much to the total weighted sentiment.
Interpretation
Value > 1.0 → Market participants are net-long (bullish bias).
Value < 1.0 → Market participants are net-short (bearish bias).
Strength of deviation from 1.0 indicates positioning imbalance magnitude.
Because the ratio is OI-weighted, large players or heavily margined exchanges influence the output proportionally more than smaller, low-volume venues — making this metric a better reflection of true market positioning rather than isolated retail sentiment.
Usage and Applications
Use this indicator as a component in:
Orderflow and sentiment confirmation, alongside price action and volume.
Funding rate correlation studies.
Intraday reversals or exhaustion zones, when combined with volatility or OI delta metrics.
Overlaying or combining this indicator with open interest change, cumulative volume delta, or funding rate divergence allows traders to build a high-resolution understanding of positioning shifts and crowd behavior.
Notes
The “Lite” version is optimized for execution and accessibility, focusing on accuracy while staying within Pine Script’s computational limits.
Exchange data availability may vary by symbol; unsupported pairs automatically return na and are automatically not included in the weighted calculation.
In summary:
This indicator transforms fragmented, exchange-specific Long/Short Ratio into a unified, OI-weighted global sentiment measure — a foundational tool for traders seeking to quantify derivative-side orderflow bias with cross-venue accuracy.
This indicator provides a cross-exchange, open-interest-weighted aggregation of the Long/Short Ratio (LSR) for the cryptocurrency asset currently on your chart. It is designed to unify fragmented derivatives positioning data from multiple major exchanges into a single normalized signal that more accurately reflects real market sentiment and positioning bias across platforms.
Concept and Originality
Traditional Long/Short Ratio indicators are exchange-specific. They show how many traders are long versus short, but only within the scope of one venue (e.g., Binance or Bybit). This makes them incomplete and often misleading for directional bias analysis, since different exchanges host different participant profiles, levels of leverage, and quote-currency exposures.
This script addresses that limitation by:
Aggregating LSR data across multiple exchanges (Binance and Bybit).
Weighting each ratio by Open Interest (OI) — ensuring exchanges with higher open positions contribute proportionally more to the overall sentiment.
Normalizing all contract types (USDT, USDC, and USD-margined) into a consistent base-currency format.
This step corrects for structural differences between coin- and stablecoin-margined instruments, producing a true like-for-like comparison.
The result is a globalized Long/Short Ratio, normalized by exposure and liquidity, suitable for multi-venue orderflow estimation and directional bias assessment.
Note for moderators: I know there are already other scripts out there, but they may not support Open Interest Weighting or the same number of pairs. They also might not support proper normalization like in my script.
Calculation Methodology
For each supported exchange and contract type:
The script retrieves the latest Long/Short Ratio (LSR) and Open Interest (OI) values.
OI is used as the weighting factor, creating a proportional representation of positioning volume.
Values denominated in USD are normalized into base currency using close-price adjustment.
The final value is computed as:
Weighted LSR = (Σ (LSRᵢ × OIᵢ)) / (Σ OIᵢ)
This ensures that if, for example, Binance has twice the open interest of Bybit, its LSR contributes twice as much to the total weighted sentiment.
Interpretation
Value > 1.0 → Market participants are net-long (bullish bias).
Value < 1.0 → Market participants are net-short (bearish bias).
Strength of deviation from 1.0 indicates positioning imbalance magnitude.
Because the ratio is OI-weighted, large players or heavily margined exchanges influence the output proportionally more than smaller, low-volume venues — making this metric a better reflection of true market positioning rather than isolated retail sentiment.
Usage and Applications
Use this indicator as a component in:
Orderflow and sentiment confirmation, alongside price action and volume.
Funding rate correlation studies.
Intraday reversals or exhaustion zones, when combined with volatility or OI delta metrics.
Overlaying or combining this indicator with open interest change, cumulative volume delta, or funding rate divergence allows traders to build a high-resolution understanding of positioning shifts and crowd behavior.
Notes
The “Lite” version is optimized for execution and accessibility, focusing on accuracy while staying within Pine Script’s computational limits.
Exchange data availability may vary by symbol; unsupported pairs automatically return na and are automatically not included in the weighted calculation.
In summary:
This indicator transforms fragmented, exchange-specific Long/Short Ratio into a unified, OI-weighted global sentiment measure — a foundational tool for traders seeking to quantify derivative-side orderflow bias with cross-venue accuracy.
סקריפט קוד פתוח
ברוח TradingView אמיתית, היוצר של הסקריפט הזה הפך אותו לקוד פתוח, כך שסוחרים יכולים לבדוק ולאמת את הפונקציונליות שלו. כל הכבוד למחבר! למרות שאתה יכול להשתמש בו בחינם, זכור שפרסום מחדש של הקוד כפוף לכללי הבית שלנו.
כתב ויתור
המידע והפרסומים אינם אמורים להיות, ואינם מהווים, עצות פיננסיות, השקעות, מסחר או סוגים אחרים של עצות או המלצות שסופקו או מאושרים על ידי TradingView. קרא עוד בתנאים וההגבלות.
סקריפט קוד פתוח
ברוח TradingView אמיתית, היוצר של הסקריפט הזה הפך אותו לקוד פתוח, כך שסוחרים יכולים לבדוק ולאמת את הפונקציונליות שלו. כל הכבוד למחבר! למרות שאתה יכול להשתמש בו בחינם, זכור שפרסום מחדש של הקוד כפוף לכללי הבית שלנו.
כתב ויתור
המידע והפרסומים אינם אמורים להיות, ואינם מהווים, עצות פיננסיות, השקעות, מסחר או סוגים אחרים של עצות או המלצות שסופקו או מאושרים על ידי TradingView. קרא עוד בתנאים וההגבלות.