Market structure reference
All 8 market structure in AlgoBarsX, each with its parameters, defaults, ranges and an example: highest, lowest, pivots, swing_high, swing_low, fractals, zigzag, support_resistance.
highest lowest pivots swing_high swing_low fractals zigzag support_resistance
highest(source = high, length = 20)→ like source#
Highest value over the last bars.
Parameters
| Name | Type | Default | Range | What it is |
|---|---|---|---|---|
source | series<number> | high | Series to calculate from. | |
length | int | 20 | 1 to 5000 | Number of bars in the calculation. |
top = highest(high, 20)strategyindicatoralertlibrarysince 1.0
lowest(source = low, length = 20)→ like source#
Lowest value over the last bars.
Parameters
| Name | Type | Default | Range | What it is |
|---|---|---|---|---|
source | series<number> | low | Series to calculate from. | |
length | int | 20 | 1 to 5000 | Number of bars in the calculation. |
bottom = lowest(low, 20)strategyindicatoralertlibrarysince 1.0
pivots(left = 5, right = 5, on = bars())→ Pivots#
Confirmed pivot highs and lows; each fires on its confirmation bar, never the pivot bar.
Parameters
| Name | Type | Default | Range | What it is |
|---|---|---|---|---|
left | int | 5 | 1 to 500 | Bars to the left. |
right | int | 5 | 1 to 500 | Bars to the right. |
on | BarSet | bars() | Bars to calculate on; defaults to the script's own bars. |
Outputs, read with a dot
| Name | Type | What it is |
|---|---|---|
high | series<price> | Latest confirmed pivot high. |
low | series<price> | Latest confirmed pivot low. |
pv = pivots(left: 5, right: 5)strategyindicatoralertlibrarysince 1.0
swing_high(left = 5, right = 5, on = bars())→ series<price>#
Latest confirmed swing high.
Parameters
| Name | Type | Default | Range | What it is |
|---|---|---|---|---|
left | int | 5 | 1 to 500 | Bars to the left. |
right | int | 5 | 1 to 500 | Bars to the right. |
on | BarSet | bars() | Bars to calculate on; defaults to the script's own bars. |
last_swing_high = swing_high(left: 5, right: 5)strategyindicatoralertlibrarysince 1.0
swing_low(left = 5, right = 5, on = bars())→ series<price>#
Latest confirmed swing low.
Parameters
| Name | Type | Default | Range | What it is |
|---|---|---|---|---|
left | int | 5 | 1 to 500 | Bars to the left. |
right | int | 5 | 1 to 500 | Bars to the right. |
on | BarSet | bars() | Bars to calculate on; defaults to the script's own bars. |
last_swing_low = swing_low(left: 5, right: 5)strategyindicatoralertlibrarysince 1.0
fractals(periods = 2, on = bars())→ Fractals#
Williams fractals.
Parameters
| Name | Type | Default | Range | What it is |
|---|---|---|---|---|
periods | int | 2 | 1 to 50 | Bars on each side. |
on | BarSet | bars() | Bars to calculate on; defaults to the script's own bars. |
Outputs, read with a dot
| Name | Type | What it is |
|---|---|---|
up | series<bool> | Up fractal confirmed. |
down | series<bool> | Down fractal confirmed. |
fr = fractals(2)strategyindicatoralertlibrarysince 1.0
zigzag(deviation = 5%, depth = 10, on = bars())→ list<Swing>#
Zigzag swing points.
Parameters
| Name | Type | Default | Range | What it is |
|---|---|---|---|---|
deviation | percent | 5% | Smallest reversal. | |
depth | int | 10 | 1 to 500 | Fewest bars between points. |
on | BarSet | bars() | Bars to calculate on; defaults to the script's own bars. |
swings = zigzag(deviation: 5%, depth: 10)strategyindicatoralertlibrarysince 1.0
support_resistance(length = 200, touches = 2, on = bars())→ list<Level>#
Support and resistance levels.
Parameters
| Name | Type | Default | Range | What it is |
|---|---|---|---|---|
length | int | 200 | 1 to 5000 | Bars to scan. |
touches | int | 2 | 1 to 100 | Fewest touches for a level. |
on | BarSet | bars() | Bars to calculate on; defaults to the script's own bars. |
key_levels = support_resistance(200, touches: 2)strategyindicatoralertlibrarysince 1.0