Fractal
Fractal marks the swing tops and bottoms of the price action and executes orders at the fractal levels.
Role in the strategy
| Slot | Available | Role |
|---|---|---|
| Entry Point | Yes | Enters at the up or down fractal levels. |
| Entry Rule | Yes | Filters entries by the proposed entry price relative to an available Up or Down Fractal. |
| Exit Point | Yes | Exits at the up or down fractal levels. |
| Exit Rule | No | — |
The Fractal provides pending order levels and entry-only price filters, but no ordinary signal or exit rules.
As an exit point it places a resting order the bar reaches, so it allows no exit rules: Exit Rules are available only behind Bar Open or Bar Close.
Logic rules
- Entry Point: Enter long at Up Fractal, Enter long at Down Fractal.
- Exit Point: Exit long at Up Fractal, Exit long at Down Fractal.
With Up Fractal the long order price is the up fractal level and the short order price is the down fractal level; with Down Fractal the mapping is reversed. Both directions are always allowed — the rules decide the direction.
Four entry-only rules compare the proposed Entry Point price with a fractal level: The position opens below/above Up Fractal and The position opens below/above Down Fractal. As with the point mapping, short comparisons use the opposite fractal level and reverse the inequality. A missing or expired reference denies only the direction that needs it; the rule reads the availability-aligned level (confirmed at c + 3), never an unconfirmed fractal, and never the gap-adjusted order price.
Parameters
None.
Calculation
engine/indicators/indicator-fractal.ts detects the fractal tops and bottoms on the high and low series with the same 5-bar rule as the MT5 integrated iFractals indicator: the middle bar is a top when its high is strictly above the two newer highs and at or above the two older ones (a tie resolves to the newest bar of a plateau); the bottom rule mirrors it. Four components hold the data:
- Up Fractal and Down Fractal chart lines (level lines on the price chart).
- Long position price and Short position price (undisplayed, marked with the traded direction).
A fractal is confirmed two bars after its bar, so its level becomes usable at the next bar open (bar c + 3). It then persists until the price crosses it ("Visible" propagation) and expires once its candidate bar is older than 97 bars.
Backtesting
- Pending orders sit at the up and down fractal levels, which are distinct: both orders can be placed, and the intrabar interpolation decides which side fills first when both levels are inside the bar. When the two levels coincide, the bar is ambiguous.
- With Bar Close as the exit point the scenario is IndicatorClose; with another indicator exit point it is IndicatorIndicator. See the scenario table in the Indicators index.
- A level that is not reached expires after 97 bars; orders are refreshed with the next detected fractal.