Skip to content

docs: correct the reason crude's back-adjusted series goes negative - #87

Merged
mspinola merged 1 commit into
mainfrom
claude/correct-backadj-negative-claim
Aug 1, 2026
Merged

mspinola merged 1 commit into
mainfrom
claude/correct-backadj-negative-claim

Conversation

@mspinola

@mspinola mspinola commented Aug 1, 2026

Copy link
Copy Markdown
Owner

Found by a test failing against real data while building crowdmon's notional module. The number was right, the explanation was wrong, and the real one is a better argument for the same conclusion.

I wrote that crude's back-adjusted series "reaches -27.52, which is not a price", attributing it to additive back-adjustment accumulating roll gaps below zero over decades.

Measured: both series bottom in April 2020. What actually happens is that the single enormous roll gap out of the May 2020 contract, which settled at -37.63, is propagated backwards through every earlier bar.

The sharpest row in the store is 2020-04-21:

Series 2020-04-20 2020-04-21
unadjusted -37.63 +11.57
back-adjusted -18.66 -27.52

Crude traded at an ordinary positive price on the 21st while the back-adjusted bar reported a large negative one. Crude was genuinely below zero on exactly one day; the back-adjusted series is below zero on 64.

A second claim was also wrong

I asserted the unadjusted series can never be negative. It can, because 2020-04-20 happened and unadj records it faithfully.

That matters for implementations: a negative price is not by itself evidence of the wrong series, so normalisation code must not clip or reject one. On that day a long position genuinely had negative notional, and anything assuming sign(notional) == sign(position) is wrong on real data. crowdmon's notional.py now says so explicitly.

Unaffected

The primary evidence stands: the +294% / +257% / +194% errors are measured directly, and the CL offset is 0.0000 today against 105.47 on 2004-12-13.

Docs only. 257 tests still pass.

Generated with Claude Code

Found by a test failing against real data while building crowdmon's
notional module. The number was right, the explanation was wrong, and the
real one is a better argument for the same conclusion.

I wrote that crude's back-adjusted series "reaches -27.52, which is not a
price", attributing it to additive back-adjustment accumulating roll gaps
below zero over decades. Measured: both series bottom in April 2020. What
actually happens is that the single enormous roll gap out of the May 2020
contract, which settled at -37.63, is propagated backwards through every
earlier bar.

The sharpest row in the store is 2020-04-21: crude traded at +11.57, an
ordinary positive price, while the back-adjusted bar for that day reads
-27.52. Crude was genuinely below zero on exactly ONE day; the
back-adjusted series is below zero on 64.

A second claim in the same paragraph was also wrong. I asserted the
unadjusted series can never be negative; it can, because 2020-04-20
happened and unadj records it faithfully. That matters for
implementations: a negative price is not by itself evidence of the wrong
series, so normalisation code must not clip or reject one. On that day a
long position genuinely had negative notional, and anything assuming
sign(notional) == sign(position) is wrong on real data.

The primary evidence is unaffected: the +294% / +257% / +194% errors are
measured directly, and the CL offset is 0.0000 today against 105.47 on
2004-12-13.

Docs only; 257 tests still pass.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@mspinola
mspinola merged commit f2ace27 into main Aug 1, 2026
5 checks passed
@mspinola
mspinola deleted the claude/correct-backadj-negative-claim branch August 1, 2026 16:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant