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.
A wall is a level with a lot resting on it: $1M or more by default, for at least a minute. This script draws the biggest walls resting now, three a side, as lines with their size, and marks each wall that loses more than half its size: F when it was filled, traded away by takers, and P when it was pulled, gone with no trades at its price and not moved nearby. Filled walls show where size was absorbed; pulled walls show liquidity that left before price reached it.

How it works

book() reads the live order book level by level, and onUpdate runs for each book the page receives, with the levels that changed and the size each one had before. trades() runs first at the same moment, so the trades of a block come before the book that block left: the script sums the size traded at each price since the book last changed, and an update that shrinks a wall checks that sum. At least half the size gone traded away is a fill; less is a pull. Market makers move size around many times a minute, so a level counts as a wall only once it has rested for Rested at least, from when it first reached the size; the script keeps that time per price in live state. Most walls that leave their price have moved, not gone: on BTC on 2026-10-16, 33 of 34 walls that left with no trades turned up again on the same side within 0.1% within 3 seconds. So a wall that leaves its price and turns up on its side within 0.1% within 3 seconds, at least half as big, is the same wall moving: it keeps the time it began resting, its line follows it, and it gets no mark. That covers a wall pulled and put back at the same price too. A wall that leaves with no trades is marked P only once 3 seconds pass with no wall turning up near it, so its mark can land on the bar after. Change MOVE_PCT and MOVE_MS at the top to follow walls further or longer. The marks are tallies, so each bar shows the walls that ended in it. changes leaves out levels that only came into the 400 levels held or left them as the book moved, so a wall that drifts out of reach is not taken for a pull. The book is live only: the marks start when the chart opens, and older bars have none. The lines are drawn only on the bar still forming, so they are always the walls resting now.

Try changing

  • Change Wall (USD) for the market: $1M is a wall on BTC, and more than most other markets’ whole book.
  • Lower Rested at least to see how often size near the touch is pulled and placed again.
  • Count the filled and pulled size per bar as two histograms in a pane of their own, to see which way walls end over a session.

The script

book-walls.ts

Next step

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