Skip to content
Algo Trade Analytics Docs

ta.pivot_point_levels() - Pine Script Function

Calculates the pivot point levels using the specified type and anchor.

ta.pivot_point_levels(type, anchor, developing) → array<float>
NameTypeDescription
typeseries stringThe type of pivot point levels. Possible values: “Traditional"
"Fibonacci”
“Woodie”
“Classic”
“DM”
“Camarilla”.

An array with numerical values representing 11 pivot point levels: [P, R1, S1, R2, S2, R3, S3, R4, S4, R5, S5]. Levels absent from the specified type return na values (e.g., “DM” only calculates P, R1, and S1).

  • 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.
//@version=6
indicator("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 weekChange
for pivotLevel in pivotPointsArray
line.new(time, pivotLevel, time + timeframe.in_seconds(timeframe) * 1000, pivotLevel, xloc=xloc.bar_time)