f/scripts
Greg Pomerantz 43ddd3ec7f Repair Yahoo adj-close/event-date misalignment (JLPSX, JLPYX)
JLPSX showed a bogus +29.3%/-22.9% 3-day wiggle in Dec 2020: Yahoo dated
the 6.824 year-end cap-gain distribution on the 12-11 record date but the
market went ex-div on 12-14 (close 30.10 -> 23.22), so the raw Adj Close
column pre-applied the adjustment 3 days before the price actually fell.

New 'history' correction op ({date: {col: value}}) patches individual OHLC
cells at bundle assembly (full build, incremental, and correction-changed
recompute paths); check_corrections validates dates/columns; 4 new tests.

scripts/scan_adj_misalign.py finds the artifact set-wide: 481 hits on 278
symbols, overwhelmingly December year-end distributions of value funds
(JLPSX's class of fund). scripts/fix_adj_misalign.py repairs it
arithmetic-only (rescale adj in [event, ex-div) by (1-f); cumulative
returns unchanged, cross-checked implied dist vs the price drop). Applied
to the only curated-fund hit (JLPSX) and its sister class JLPYX (implied
dist 6.824 both = official amount; ex-div 2020-12-14). The remaining ~276
symbols are reported in reports/adj_misalign/scan.md for a bulk run.
2026-08-31 23:08:42 -04:00
..
apply_dedup_corrections.py Double-listing: layout-agnostic invariants, whole-dump sweep, bulk corrections 2026-08-31 21:00:36 -04:00
audit_stale.py Freeze stale (Yahoo-empty) tickers: snapshot final series in overrides/frozen/ 2026-08-31 13:23:24 -04:00
backup_events.py Event-history protection: backup dir, empty-download fallback, docs 2026-08-31 21:59:25 -04:00
check_corrections.py Repair Yahoo adj-close/event-date misalignment (JLPSX, JLPYX) 2026-08-31 23:08:42 -04:00
clean_multivintage.py Clean multi-vintage 'ctime' files: 1,065 files, 2.2M stale rows 2026-08-31 22:25:02 -04:00
fix_adj_misalign.py Repair Yahoo adj-close/event-date misalignment (JLPSX, JLPYX) 2026-08-31 23:08:42 -04:00
scan_adj_misalign.py Repair Yahoo adj-close/event-date misalignment (JLPSX, JLPYX) 2026-08-31 23:08:42 -04:00
scan_double_listing.py Clean multi-vintage 'ctime' files: 1,065 files, 2.2M stale rows 2026-08-31 22:25:02 -04:00
verify_official.py Event-history protection: backup dir, empty-download fallback, docs 2026-08-31 21:59:25 -04:00