Order blocks
The 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 |
Outputs
| Name | Type | Required | Description |
|---|---|---|---|
| swing_bull_1 | zone | Optional | color theme.up/0.20, style area |
| swing_bull_2 | zone | Optional | color theme.up/0.20, style area |
| swing_bull_3 | zone | Optional | color theme.up/0.20, style area |
| swing_bull_4 | zone | Optional | color theme.up/0.20, style area |
| swing_bull_5 | zone | Optional | color theme.up/0.20, style area |
| swing_bear_1 | zone | Optional | color theme.down/0.20, style area |
| swing_bear_2 | zone | Optional | color theme.down/0.20, style area |
| swing_bear_3 | zone | Optional | color theme.down/0.20, style area |
| swing_bear_4 | zone | Optional | color theme.down/0.20, style area |
| swing_bear_5 | zone | Optional | color theme.down/0.20, style area |
| internal_bull_1 | zone | Optional | color theme.up/0.10, style area |
| internal_bull_2 | zone | Optional | color theme.up/0.10, style area |
| internal_bull_3 | zone | Optional | color theme.up/0.10, style area |
| internal_bull_4 | zone | Optional | color theme.up/0.10, style area |
| internal_bull_5 | zone | Optional | color theme.up/0.10, style area |
| internal_bear_1 | zone | Optional | color theme.down/0.10, style area |
| internal_bear_2 | zone | Optional | color theme.down/0.10, style area |
| internal_bear_3 | zone | Optional | color theme.down/0.10, style area |
| internal_bear_4 | zone | Optional | color theme.down/0.10, style area |
| internal_bear_5 | zone | Optional | color theme.down/0.10, style area |
| bull_mitigated | event | Optional | color theme.neutral, shape circle, style marker, where below_bar |
| bear_mitigated | event | Optional | color theme.neutral, shape circle, style marker, where below_bar |
- Warm-up
- 0 bars (0 at the defaults)
- Repaints
- No
- Parity
- None
Formula
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.