Live Order Blocks
Live Order Blocks is an indicator drawn over the price chart.
statesmart money
1
indicator "Live Order Blocks"2
pane: price3
4
input keep = 105
6
state zones: list<Zone> = []7
8
for ob in order_blocks(new_only: true):9
zones.push(ob)10
zones = zones.filter(z => not z.mitigated).keep_last(keep)11
12
for z in zones:13
box id: z.id, from: (z.formed_bar, z.top), to: (bar.index, z.bottom), color: if z.bullish then green.fade(80) else red.fade(80)What this script says
Live Order Blocks is an indicator drawn over the price chart.
You can change one input: keep (default 10).
It remembers zones from one bar to the next.
It calculates zones as zones.filter(z => not z.mitigated).keep_last(keep).
On each bar, it goes through each ob in the order blocks and adds ob to zones.
On each bar, it goes through each z in zones and draws a box.