OrderBlocks

forge.taclassSince Forge API 1
Signaturepython
forge.ta.OrderBlocks(**inputs: Any) -> None

The last opposite candle before a break of structure, kept until price trades back through it.

Inputs

NameTypeDefaultRange
swing_lenint52 to 100
internal_lenint21 to 99
internalbooltrue
swingbooltrue
show_lastint51 to 5
mitigationchoicewick
break_onchoiceclose

Indicator: Order blocks

Breaks are found as in market structure, with swing_len, internal_len and break_on. For an upward break, Forge takes the lowest low between the broken swing high and the break bar; the order block is the last down candle (close below open) at or before that low, back to the swing high. Its box spans that candle's high and low. A downward break mirrors it with the last up candle.

A block is shown from the break bar on. A bullish block is mitigated and removed when price trades below its low (mitigation wick) or closes below it (mitigation close); a bearish block mirrors it. bull_mitigated and bear_mitigated mark the bar.

Internal and swing blocks are tracked apart and turned on or off by internal and swing. Slot 1 is the newest unmitigated block of its kind; show_last slots are shown. Forge keeps the five newest unmitigated blocks per kind.