Learning objectives
- Use translation and scaling properties to test pivot implementations.
- Distinguish mathematical invariance from tick-rounded order behavior.
Prerequisites: Compute floor pivots and the central pivot range.
Mechanism and interpretation
A useful implementation test changes the units of every input while preserving their relationship. If H, L and C each increase by a constant k, every traditional floor-pivot level increases by k. The range H−L is unchanged. If every input is multiplied by a positive factor a, all levels and widths multiply by a. These properties follow from the formulas and can catch swapped inputs, omitted terms or inconsistent adjustments.
For the central pivot range, compute M=(H+L)/2 and the raw companion 2P−M, then sort the two edges. Translation leaves its width unchanged; positive scaling multiplies width by a. Testing only one convenient price example can miss an error. Include closes at the midpoint, near both extremes, and negative input values where the instrument permits them. Invariance tests verify arithmetic structure, not the usefulness of a trading signal.
Worked case · synthetic data
For synthetic H=120, L=90, C=105, P=105, R1=120, S1=90. Adding 7 to every input produces P=112, R1=127, S1=97. Multiplying the original inputs by 0.5 gives 52.5,60 and 45. A program that adds 7 to P but 14 to R1 has transformed the formula incorrectly. A zero-width CPR at the midpoint remains zero-width under either valid transform.
Failure modes and context
Tick rounding can break exact equality after a coordinate change if the tick grid is not transformed too. Rounding inputs before calculating is a different method from rounding final order prices. Ratio-based formulas may have different translation properties; do not impose a floor-pivot identity on every named indicator. Floating-point comparisons need a declared tolerance.
Practice assignment
Use H=88, L=72, C=80. Calculate P, R1, S1, then predict the values after subtracting 3 from every input and after doubling every input. Explain how to test a rounded result without rejecting a correct unrounded calculation.
Worked answer
Original levels are 80,88,72. Translation by−3 gives 77,85,69. Scaling by 2 gives 160,176,144. First compare full-precision outputs within a small numerical tolerance. Test the declared tick-rounding operation separately, including its direction and tie rule; a price-grid discrepancy is not automatically a pivot-formula error.
Check your understanding
Question 1
How does adding 5 to H, L, C change a traditional R1?
- It adds 5
- It adds 10
- It leaves R1 unchanged
Reveal answer and reasoning
A. It adds 5
R1=2P−L gains 10 through 2P and loses 5 through the shifted low.
Question 2
What happens to CPR width under translation?
- It increases by the shift
- It always becomes zero
- It is unchanged
Reveal answer and reasoning
C. It is unchanged
Both boundaries shift equally, leaving their separation unchanged.
Question 3
What do invariance checks establish?
- Guaranteed fill quality
- Consistency with mathematical identities
- Predictive profitability
Reveal answer and reasoning
B. Consistency with mathematical identities
They test implementation behavior, while economic and execution claims require different evidence.
