Examples

Large orders pulled before price reaches them

A large resting order that never trades and disappears as price comes near is a classic reason to distrust displayed size. This script inspects every cancel: the order's size, its age, whether it was ever filled, and how close price was when it left.

StrateScript
indicator "Pulled before touch" { overlay: true }

minSize = input.int("Min size", 100, min: 1)
minAge = input.duration("Min age", 2s)
maxTicks = input.int("Price within (ticks)", 4, min: 1)

state filledIds = map()    // ids of orders that traded at least once

on order(o) {
  if o.is_fill { filledIds[o.id] = true }
  if o.is_cancel and o.previous_size >= minSize and o.age >= minAge and not filledIds.has(o.id) {
    // distance between the canceled order and the opposite best price (where trades happen)
    best = o.side == "bid" ? mbo.best_ask : mbo.best_bid
    if not na(best) {
      dist = abs(best - o.price) / instrument.tick
      if dist <= maxTicks and dist >= 1 {
        label.new(o.time, o.price, "pulled " + str(o.previous_size) + " at " + str(dist) + "t", color: #ffb300)
      }
    }
  }
  // forget an order only once nothing of it is left in the book
  if (o.is_cancel or o.is_fill) and na(mbo.order(o.id)) { filledIds.remove(o.id) }
}

What to notice:

STRATE / PRODUCT SCREENSHOT

Actual platform screenshot.