fractals
forge.tafunctionSince Forge API 1
Functionpython
forge.ta.fractals(high: ArrayLike,low: ArrayLike) -> dict[str, np.ndarray]Williams fractals: up (swing high) and down (swing low), written two bars late.
Parameters
| Name | Type |
|---|---|
| high | ArrayLike |
| low | ArrayLike |
A bar is a swing high when its high is above the two bars after it and at least the two bars before it (MetaTrader 5's own asymmetry); swing lows mirror that. The value sits on the bar that confirms it, never earlier. NaN on the first 4 bars and wherever the pattern does not hold.
Classpython
forge.ta.Fractals(**inputs: Any) -> NoneSwing highs and lows, shown two bars after they form.
Parameters
| Name | Type |
|---|---|
| **inputs | Any |
An up fractal is a bar whose high is above the next two highs and at least the two before it. A down fractal mirrors it with the lows.
It is written on the bar that confirms it, two bars after the centre, and drawn back on the centre bar.