Documentation Index
Fetch the complete documentation index at: https://docs.darvas.app/llms.txt
Use this file to discover all available pages before exploring further.
Functions
ta.pivothigh(source, leftBars, rightBars)
Returns the pivot high value if the bar at rightBars ago is higher than all leftBars bars before it and all rightBars bars after it. Returns NaN otherwise.
ta.pivotlow(source, leftBars, rightBars)
Returns the pivot low value under the same symmetric condition.
The lag
Parameters
Source function. Typically
ctx.high for pivot highs, ctx.low for pivot lows.Number of bars to the left that must be lower (for pivothigh) or higher (for pivotlow).
Number of bars to the right that must be lower/higher. This is also the lag: the pivot result is known
rightBars after the candidate bar.Basic example
Choosing left/right bars
leftBars = rightBars | Effect |
|---|---|
| 2-3 | Very sensitive, many pivots, noisy |
| 5 | Standard - good balance |
| 10+ | Few pivots, only major swings |
pivothigh(ctx.high, 3, 8)) but less common.
Related pages
Support/resistance example
Full indicator using pivothigh/pivotlow + Line entities.
Aggregators
ta.highest/lowest for simpler range detection.
NaN handling
na() check before using pivot results.