pivothigh
Detects pivot high (local peak) points in a data series
pivothigh(source, leftbars, rightbars)
Parameters
| Name | Type | Description |
|---|---|---|
source |
field | Data series (commonly high) |
leftbars |
int | Bars before pivot that must be lower |
rightbars |
int | Bars after pivot that must be lower |
Formula
pivothigh = source[rightbars] when it exceeds all leftbars preceding and rightbars following values, else NULL
Examples
// detect swing high with 2-bar confirmation
pivothigh(high, 2, 2) != null;
// swing high above 200 (resistance breakout)
x = pivothigh(high, 5, 5); x > 200;
// any detected swing high on close
pivothigh(close, 3, 3) != null;
Returns
field — may be NULL
Range
leftbars and rightbars each must be 1-400, and their sum must not exceed 400
Notes
Most bars return NULL -- only a confirmed local peak yields a value