OrderBlocks
forge.ta.OrderBlocks(**inputs: Any) -> NoneThe last opposite candle before a break of structure, kept until price trades back through it.
Inputs
| Name | Type | Default | Range |
|---|---|---|---|
| swing_len | int | 5 | 2 to 100 |
| internal_len | int | 2 | 1 to 99 |
| internal | bool | true | |
| swing | bool | true | |
| show_last | int | 5 | 1 to 5 |
| mitigation | choice | wick | |
| break_on | choice | close |
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.