An order block is a popular price-action concept: the last candle against the direction of a strong move. The idea is that this candle shows where larger participants were active before the impulse, and that price often returns to the zone before continuing.
The indicator needs a clear rule to call a move "strong", so it uses objective conditions (all measured on closed bars):
After a block is confirmed, its state is tracked on every new price:
The indicator keeps a list of active zones. At the start it scans a limited number of bars; after that, each new closed bar is processed once and each tick only updates the states of the listed zones. The full history is never rescanned.
| Input | Default | Purpose |
|---|---|---|
| Detection | ||
| InpImpulseBars | 3 | Number of bars after the block in which the impulse must appear (2 to 10) |
| InpImpulseMult | 2.0 | Minimum impulse size in average candle ranges (0.5 to 10) |
| InpAvgPeriod | 14 | Period of the average candle (High-Low) range (2 to 100) |
| InpZoneMode | OB_ZONE_RANGE | Zone height: OB_ZONE_RANGE (High-Low) or OB_ZONE_BODY (Open-Close) |
| InpLookbackBars | 500 | Number of bars scanned when the indicator starts (30 to 5000) |
| InpMaxZones | 20 | Maximum number of zones kept; the oldest is dropped first (1 to 200) |
| Mitigation | ||
| InpMitigation | OB_MIT_TOUCH | When a block is mitigated: OB_MIT_TOUCH (price enters the zone) or OB_MIT_HALF (price reaches the middle of the zone) |
| InpShowMitigated | true | Keep mitigated blocks on the chart; if false they are deleted at mitigation |
| InpMitigatedColor | clrDimGray | Color of mitigated blocks |
| Appearance | ||
| InpBullColor | clrWhite | Color of bullish order blocks |
| InpBearColor | clrGray | Color of bearish order blocks |
| InpZoneStyle | STYLE_DASH | Border style of fresh blocks |
| InpZoneWidth | 1 | Border width (1 to 5) |
| InpFillZones | false | Fill fresh blocks with color |
| InpExtendBars | 20 | Number of bars the zones extend to the right of the last bar (0 to 200) |
| InpShowLabels | true | Show a text label at the left edge of each block |
| InpLabelSize | 8 | Label font size (6 to 20) |
| Alerts | ||
| InpAlertNew | false | Show an alert when a new order block is confirmed |

Fig. 1. OrderBlockMarker on an M15 chart with default settings: two fresh blocks and one mitigated block (black and white image per Code Base guidelines).
Fair Value Gap (FVG) Detector with Auto-Removal When Filled
Fair Value Gap (FVG) Detector with Auto-Removal When Filled
Index Gap Marker – daily opening gaps and fill status
Shows the daily opening gaps for stock indices and indicates whether each one has been filled.
Fair Value Gap (FVG) Detector with Auto-Removal When Filled
Detects bullish and bearish Fair Value Gaps (three-candle price imbalances), draws them as boxes extending to the right and automatically removes each box once the price fills the gap.
Break of Structure (BOS) and Change of Character (CHoCH) Labels
Detects swing highs and lows and labels every break of market structure: BOS (Break of Structure) when the trend continues and CHoCH (Change of Character) when the trend reverses.