Skip to main content
This script reads only live data, so it has no history to draw: open it on a chart and watch it fill in.

Open on a chart

Load it on BTC 1m in the terminal, then change its settings or open it in the script editor.
The bid’s share of the resting size within a band around the mid: above 0.5, more size waits to buy than to sell.

How it works

depth() reads the book the page shows, so it has no history: the line starts when the chart opens and grows live. For the book on every bar of history, from 0xArchive’s full-depth archive, use orderBook() and its imbalance(band).

The script

book-imbalance.ts

Next step

See the next example, EMA.
Last modified on October 16, 2026