PROTECTED SOURCE SCRIPT
Zaktualizowano

Aggregated Net Positions

69
Coyote Net Positions — a histogram indicator that answers one question on every bar: who is entering, and who is exiting?

It combines aggregated Open Interest from multiple exchanges with real Volume Delta to classify each bar into one of four positioning states. The result is a clean histogram where green bars go up (bullish), red bars go down (bearish), and gray bars show closing/unwinding activity. Noise is dimmed. Only the moves that matter get color.


== THE 4-STATE POSITIONING FORMULA ==

Two inputs, four outputs:

Open Interest Change (OI) — did the total number of open contracts increase or decrease?
Volume Delta — were aggressive buyers or sellers dominant? (real trade classification, not candle color)

Combined:

NL (New Longs) — Delta positive + OI up = fresh buyers entering the market
NS (New Shorts) — Delta negative + OI up = fresh sellers entering the market
LC (Longs Closing) — Delta negative + OI down = existing longs exiting or being liquidated
SC (Shorts Closing) — Delta positive + OI down = existing shorts covering or being squeezed

This is the same formula used by professional order flow traders to read net positioning from derivatives data.


== HOW THE HISTOGRAM WORKS ==

Each bar is a column from zero. The direction is based on the positioning state, not raw OI change:

Bullish states go UP: New Longs (green), Shorts Closing (gray)
Bearish states go DOWN: New Shorts (red), Longs Closing (gray)

The magnitude equals the absolute OI change in USD terms. Bigger bar = more contracts moved.

Green bar going up = new bullish fuel entering. This is the signal that matters most.
Red bar going down = new bearish fuel entering. Sellers are pressing.
Gray bars = positions unwinding. No new fuel — the move is losing steam.


== SIGNIFICANCE MODE ==

Most bars are noise. Significance Mode uses an adaptive threshold (SMA of absolute OI change x multiplier) to separate signal from noise:

- Bars above the threshold get full positioning color (green, red, or gray)
- Bars below the threshold are dimmed to a neutral dark color
- Labels only appear on significant state transitions

The result: a clean chart where your eye is drawn to the bars that actually moved the needle. Default multiplier is 5.0 — raise it to see fewer, more extreme events. Lower it for more sensitivity.


== DATA SOURCES ==

OI is aggregated across up to 5 exchange feeds:
- Binance USDT Perpetual
- Binance USD (coin-margined) Perpetual
- Bybit USDT Perpetual
- Bybit USD (inverse) Perpetual
- OKX USDT Perpetual (optional, off by default)

Coin-margined OI is automatically normalized to USDT-equivalent before aggregation. This gives you a true cross-exchange picture of net market positioning, not just one venue.

Volume Delta uses TradingView's lower-timeframe trade classification via the ta library. This classifies each trade by aggressor side (market buy vs market sell), which is far more accurate than using candle color. Candle color fails on stop-hunt / SFP bars where price sweeps one direction but closes the other — delta tells you who was actually buying and selling.


== WHY AGGREGATE FIRST ==

The indicator aggregates OI across all exchanges into one net number, then classifies. This is intentional. When Bybit OI goes up and Binance OI goes down by a similar amount, it is often position migration (traders moving between exchanges for better funding rates), not genuine opposing activity. The aggregate correctly shows this as neutral — because the net market positioning barely changed. This prevents false signals from exchange-level noise.


== CUMULATIVE WINDOW ==

Toggle on the Cumulative Window to sum bar values over N bars (default 100). Instead of seeing per-bar spikes, you see the rolling net positioning trend. Positive cumulative = net bullish pressure building. Negative = net bearish. Useful for identifying sustained positioning shifts that span many bars.


== NORMALIZE MODE ==

Express OI change as a percentage of total open interest instead of absolute USD value. This makes the indicator comparable across different assets — a 0.5% OI change on BTC and a 0.5% OI change on ETH represent the same relative significance, even though the absolute numbers are very different.


== DISPLAY OPTIONS ==

- Only Show New Positions: hides gray closing bars, shows only green (NL) and red (NS) for a cleaner view focused on fresh fuel
- Show Label: compact triangle markers (NL, NS, LC, SC) on state transitions
- Show Value: numeric magnitude labels on significant bars
- All colors are customizable


== LABELS ==

Compact arrow markers appear on significant state transitions:

▲ NL — New Longs starting (green, bottom)
▼ NS — New Shorts starting (red, top)
▼ LC — Longs Closing (gray, top)
▲ SC — Shorts Closing (gray, bottom)

Labels only fire when the state flips from one to another AND the bar exceeds the significance threshold. This prevents label spam while still catching every meaningful transition.


== ALERTS ==

- New Longs — state flips to NL
- New Shorts — state flips to NS
- Longs Closing — state flips to LC
- Shorts Closing — state flips to SC
- Positioning Flip — any state transition


== HOW TO USE ==

1. Add below your price chart
2. Watch for bright green bars going up — these are significant new longs, the strongest bullish signal
3. Watch for bright red bars going down — significant new shorts, strongest bearish signal
4. Gray bars mean the previous move is unwinding — fuel is being spent, not added
5. When a cluster of green NL bars appears after a pullback into a demand zone, that is strong confirmation of institutional buying
6. When red NS bars appear at resistance with increasing magnitude, sellers are pressing — look for continuation short setups
7. Toggle "Only Show New Positions" for a cleaner view that strips out the noise of position unwinding


== BEST TIMEFRAMES ==

Works on any timeframe with OI data available. Most useful on 5m, 15m, and 1H for intraday crypto derivatives trading. The adaptive threshold auto-adjusts to your timeframe.


== NOTES ==

- Requires crypto perpetual futures symbols with OI data (Binance, Bybit, OKX)
- Uses 6 request.security() calls (5 OI sources + 1 volume delta)
- Auto-detects base currency from your chart symbol
Informacje o Wersji
Coyote Net Positions — a histogram indicator that answers one question on every bar: who is entering, and who is exiting?

It combines aggregated Open Interest from multiple exchanges with real Volume Delta to classify each bar into one of four positioning states. The result is a clean histogram where green bars go up (bullish), red bars go down (bearish), and gray bars show closing/unwinding activity. Noise is dimmed. Only the moves that matter get color.


== THE 4-STATE POSITIONING FORMULA ==

Two inputs, four outputs:

Open Interest Change (OI) — did the total number of open contracts increase or decrease?
Volume Delta — were aggressive buyers or sellers dominant? (real trade classification, not candle color)

Combined:

NL (New Longs) — Delta positive + OI up = fresh buyers entering the market
NS (New Shorts) — Delta negative + OI up = fresh sellers entering the market
LC (Longs Closing) — Delta negative + OI down = existing longs exiting or being liquidated
SC (Shorts Closing) — Delta positive + OI down = existing shorts covering or being squeezed

This is the same formula used by professional order flow traders to read net positioning from derivatives data.


== HOW THE HISTOGRAM WORKS ==

Each bar is a column from zero. The direction is based on the positioning state, not raw OI change:

Bullish states go UP: New Longs (green), Shorts Closing (gray)
Bearish states go DOWN: New Shorts (red), Longs Closing (gray)

The magnitude equals the absolute OI change in USD terms. Bigger bar = more contracts moved.

Green bar going up = new bullish fuel entering. This is the signal that matters most.
Red bar going down = new bearish fuel entering. Sellers are pressing.
Gray bars = positions unwinding. No new fuel — the move is losing steam.


== SIGNIFICANCE MODE ==

Most bars are noise. Significance Mode uses an adaptive threshold (SMA of absolute OI change x multiplier) to separate signal from noise:

- Bars above the threshold get full positioning color (green, red, or gray)
- Bars below the threshold are dimmed to a neutral dark color
- Labels only appear on significant state transitions

The result: a clean chart where your eye is drawn to the bars that actually moved the needle. Default multiplier is 5.0 — raise it to see fewer, more extreme events. Lower it for more sensitivity.


== DATA SOURCES ==

OI is aggregated across up to 5 exchange feeds:
- Binance USDT Perpetual
- Binance USD (coin-margined) Perpetual
- Bybit USDT Perpetual
- Bybit USD (inverse) Perpetual
- OKX USDT Perpetual (optional, off by default)

Coin-margined OI is automatically normalized to USDT-equivalent before aggregation. This gives you a true cross-exchange picture of net market positioning, not just one venue.

Volume Delta uses TradingView's lower-timeframe trade classification via the ta library. This classifies each trade by aggressor side (market buy vs market sell), which is far more accurate than using candle color. Candle color fails on stop-hunt / SFP bars where price sweeps one direction but closes the other — delta tells you who was actually buying and selling.


== WHY AGGREGATE FIRST ==

The indicator aggregates OI across all exchanges into one net number, then classifies. This is intentional. When Bybit OI goes up and Binance OI goes down by a similar amount, it is often position migration (traders moving between exchanges for better funding rates), not genuine opposing activity. The aggregate correctly shows this as neutral — because the net market positioning barely changed. This prevents false signals from exchange-level noise.


== CUMULATIVE WINDOW ==

Toggle on the Cumulative Window to sum bar values over N bars (default 100). Instead of seeing per-bar spikes, you see the rolling net positioning trend. Positive cumulative = net bullish pressure building. Negative = net bearish. Useful for identifying sustained positioning shifts that span many bars.


== NORMALIZE MODE ==

Express OI change as a percentage of total open interest instead of absolute USD value. This makes the indicator comparable across different assets — a 0.5% OI change on BTC and a 0.5% OI change on ETH represent the same relative significance, even though the absolute numbers are very different.


== DISPLAY OPTIONS ==

- Only Show New Positions: hides gray closing bars, shows only green (NL) and red (NS) for a cleaner view focused on fresh fuel
- Show Label: compact triangle markers (NL, NS, LC, SC) on state transitions
- Show Value: numeric magnitude labels on significant bars
- All colors are customizable


== LABELS ==

Compact arrow markers appear on significant state transitions:

▲ NL — New Longs starting (green, bottom)
▼ NS — New Shorts starting (red, top)
▼ LC — Longs Closing (gray, top)
▲ SC — Shorts Closing (gray, bottom)

Labels only fire when the state flips from one to another AND the bar exceeds the significance threshold. This prevents label spam while still catching every meaningful transition.


== ALERTS ==

- New Longs — state flips to NL
- New Shorts — state flips to NS
- Longs Closing — state flips to LC
- Shorts Closing — state flips to SC
- Positioning Flip — any state transition


== HOW TO USE ==

1. Add below your price chart
2. Watch for bright green bars going up — these are significant new longs, the strongest bullish signal
3. Watch for bright red bars going down — significant new shorts, strongest bearish signal
4. Gray bars mean the previous move is unwinding — fuel is being spent, not added
5. When a cluster of green NL bars appears after a pullback into a demand zone, that is strong confirmation of institutional buying
6. When red NS bars appear at resistance with increasing magnitude, sellers are pressing — look for continuation short setups
7. Toggle "Only Show New Positions" for a cleaner view that strips out the noise of position unwinding


== BEST TIMEFRAMES ==

Works on any timeframe with OI data available. Most useful on 5m, 15m, and 1H for intraday crypto derivatives trading. The adaptive threshold auto-adjusts to your timeframe.


== NOTES ==

- Requires crypto perpetual futures symbols with OI data (Binance, Bybit, OKX)
- Uses 6 request.security() calls (5 OI sources + 1 volume delta)
- Auto-detects base currency from your chart symbol

Wyłączenie odpowiedzialności

Informacje i publikacje nie stanowią i nie powinny być traktowane jako porady finansowe, inwestycyjne, tradingowe ani jakiekolwiek inne rekomendacje dostarczane lub zatwierdzone przez TradingView. Więcej informacji znajduje się w Warunkach użytkowania.