Pivot Points — each session's support/resistance ladder, computed from
the previous session's high, low and close and held flat across every
bar of the current session.
Appends ${prefix}Pivot, ${prefix}R1..R3 and ${prefix}S1..S3 (plus
${prefix}R4 / ${prefix}S4 for 'camarilla'). The levels are constant
within a session — that is the point of them: a floor trader writes the
numbers down before the open and trades against them all day.
This is the study the corpus assessment (§6.9) gates on G4: the
arithmetic was never the hard part — "prior-period H/L/C via aggregate +
hold-broadcast is easy" — the anchor rule was, and the trading calendar is
what supplies it. Where sessions come from is
SessionAnchorOptions: a calendar (the primary door) or a session-id
column on an already-partitioned series.
method is a variant menu, not two studies behind a flag
All four sets read the same three inputs and produce the same shape — a
central pivot with a ladder of support and resistance either side — and
differ in constants. That is the test keltner's maType had to pass and
keltner's hypothetical "band source" flag failed: a flag that swaps which
indicator you are computing is two studies wearing one name, and this is
not that. Each set is written out in pivotLevelValues; briefly:
'standard' — the floor-trader/classic set, P = (H+L+C)/3 with
R1 = 2P − L, R2 = P + (H−L), R3 = H + 2(P−L) and the mirrored
supports. The unqualified "pivot points" of every vendor.
'fibonacci' — the same centre with the range scaled by 38.2 % /
61.8 % / 100 %.
'woodie' — the standard ladder over the close-weighted centre
P = (H + L + 2C)/4.
'camarilla' (Nick Scott, 1989) — four pairs at 1.1/12, 1.1/6,
1.1/4, 1.1/2 of the range.
Two deliberate deltas worth naming, since both appear in the wild:
Camarilla measures from the CLOSE, not from the pivot. Its levels are
C ± k·(H−L), so P rides along as the centre line but no level is
computed from it. That is the definition; a build that centred them on P
would be a different indicator, and the fixture separates the two.
Woodie's is the (H + L + 2C)/4 form, weighting the previous close.
A second convention in circulation weights the current session's open
instead ((H + L + 2·Open)/4). We ship the previous-close form: it needs
nothing but the previous session's aggregate, matching every other method
here, and the open form would make one menu entry read a column the other
three don't.
The column set varies with the method — on purpose
Camarilla defines a fourth pair; the other three do not. The alternative
was a fixed nine columns with R4/S4 permanently undefined for three
of the four methods, which is worse in every direction: it invents columns
that have no definition, makes "missing" ambiguous between not in this
method and no previous session, and would have every consumer of a
standard-pivot chart carrying two dead series. The return type follows the
option — PivotPointsResult is conditional on method — so
.get('ppR4') type-checks only where it exists.
Warm-up, and where the missing rows are
Every bar of the first session that has bars reads undefined —
there is no previous session to measure. Not an error, and not a hole to
fill.
Every bar in closed time reads undefined, for the same reason
sessionVwap does: a bar in no session has no session's levels.
"Previous session" means the previous session with bars in this
series, not the previous entry on the calendar. A day the feed skipped
has no aggregate, and reading the calendar for one would invent a bar.
The columns share one warm-up rather than one each: every level of
every method reads all three aggregates, so a missing input blanks the
whole ladder together.
Composed
previousSessionHlcValues (the aggregate + hold-broadcast, one pass) and
pivotLevelValues (the four formula sets). The aggregates are taken over
the cells that are present — a bar with a missing high still
contributes its low — because max/min/last are three independent
order statistics, not the two halves of one ratio; see the kernel for why
that differs from the VWAP rule.
Scale and shift
Every level is an affine combination of H, L and C whose coefficients
sum to 1, so the whole ladder is equivariant under both: scaling every
price scales the levels, adding a constant to every price adds it to the
levels. Both are pinned as property tests.
Pivot Points — each session's support/resistance ladder, computed from the previous session's high, low and close and held flat across every bar of the current session.
Appends
${prefix}Pivot,${prefix}R1..R3and${prefix}S1..S3(plus${prefix}R4/${prefix}S4for'camarilla'). The levels are constant within a session — that is the point of them: a floor trader writes the numbers down before the open and trades against them all day.This is the study the corpus assessment (§6.9) gates on G4: the arithmetic was never the hard part — "prior-period H/L/C via
aggregate+ hold-broadcast is easy" — the anchor rule was, and the trading calendar is what supplies it. Where sessions come from is SessionAnchorOptions: a calendar (the primary door) or a session-id column on an already-partitioned series.methodis a variant menu, not two studies behind a flagAll four sets read the same three inputs and produce the same shape — a central pivot with a ladder of support and resistance either side — and differ in constants. That is the test
keltner'smaTypehad to pass andkeltner's hypothetical "band source" flag failed: a flag that swaps which indicator you are computing is two studies wearing one name, and this is not that. Each set is written out inpivotLevelValues; briefly:'standard'— the floor-trader/classic set,P = (H+L+C)/3withR1 = 2P − L,R2 = P + (H−L),R3 = H + 2(P−L)and the mirrored supports. The unqualified "pivot points" of every vendor.'fibonacci'— the same centre with the range scaled by 38.2 % / 61.8 % / 100 %.'woodie'— the standard ladder over the close-weighted centreP = (H + L + 2C)/4.'camarilla'(Nick Scott, 1989) — four pairs at1.1/12,1.1/6,1.1/4,1.1/2of the range.Two deliberate deltas worth naming, since both appear in the wild:
C ± k·(H−L), soPrides along as the centre line but no level is computed from it. That is the definition; a build that centred them onPwould be a different indicator, and the fixture separates the two.(H + L + 2C)/4form, weighting the previous close. A second convention in circulation weights the current session's open instead ((H + L + 2·Open)/4). We ship the previous-close form: it needs nothing but the previous session's aggregate, matching every other method here, and the open form would make one menu entry read a column the other three don't.The column set varies with the method — on purpose
Camarilla defines a fourth pair; the other three do not. The alternative was a fixed nine columns with
R4/S4permanentlyundefinedfor three of the four methods, which is worse in every direction: it invents columns that have no definition, makes "missing" ambiguous between not in this method and no previous session, and would have every consumer of a standard-pivot chart carrying two dead series. The return type follows the option — PivotPointsResult is conditional onmethod— so.get('ppR4')type-checks only where it exists.Warm-up, and where the missing rows are
undefined— there is no previous session to measure. Not an error, and not a hole to fill.undefined, for the same reason sessionVwap does: a bar in no session has no session's levels.Composed
previousSessionHlcValues(theaggregate+ hold-broadcast, one pass) andpivotLevelValues(the four formula sets). The aggregates are taken over the cells that are present — a bar with a missinghighstill contributes itslow— becausemax/min/lastare three independent order statistics, not the two halves of one ratio; see the kernel for why that differs from the VWAP rule.Scale and shift
Every level is an affine combination of
H,LandCwhose coefficients sum to 1, so the whole ladder is equivariant under both: scaling every price scales the levels, adding a constant to every price adds it to the levels. Both are pinned as property tests.