ta.pivot_point_levels() - Pine Script Function
ta.pivot_point_levels()
Section titled “ta.pivot_point_levels()”Overview
Section titled “Overview”Calculates the pivot point levels using the specified type and anchor.
Syntax
Section titled “Syntax”ta.pivot_point_levels(type, anchor, developing) → array<float>Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
| type | series string | The type of pivot point levels. Possible values: “Traditional" |
| "Fibonacci” | — | — |
| “Woodie” | — | — |
| “Classic” | — | — |
| “DM” | — | — |
| “Camarilla”. | — | — |
Returns
Section titled “Returns”An array
Remarks
Section titled “Remarks”- The developing parameter cannot be true when type is set to “Woodie”, because the Woodie calculation for a period depends on that period’s open, which means that the pivot value is either available or unavailable, but never developing. If used together, the indicator will return a runtime error.
Examples
Section titled “Examples”Example 1
Section titled “Example 1”//@version=6indicator("Weekly Pivots", max_lines_count=500, overlay=true)timeframe = "1W"typeInput = input.string("Traditional", "Type", options=["Traditional", "Fibonacci", "Woodie", "Classic", "DM", "Camarilla"])weekChange = timeframe.change(timeframe)pivotPointsArray = ta.pivot_point_levels(typeInput, weekChange)if weekChangefor pivotLevel in pivotPointsArrayline.new(time, pivotLevel, time + timeframe.in_seconds(timeframe) * 1000, pivotLevel, xloc=xloc.bar_time)