Skip to main content

What this builds

  • Bullish order blocks: bearish bar followed by a bullish engulf with above-average volume
  • Bearish order blocks: bullish bar followed by a bearish engulf with above-average volume
  • Each block drawn as a Box with extend: "right" so it projects into future bars
  • Box turns gray when price trades through the level (mitigation)

Full script

Mitigation tracking (advanced)

To detect when price mitigates an OB (trades through it), store the box levels in Series:

Notes

  • extend: "right" makes the box grow forward in time until explicitly constrained by updating x2.
  • Use unique keys (bull_ob_${prevBar}) so each detected block gets its own persistent slot.
  • Box entities count toward the 500-per-type entity budget.

Box entity

Full Box options including extend.

Series

Tracking active OB levels across bars.

API limits

500 Box entity budget.