Unilever - #185
Open
Khashayarbayati1 wants to merge 3 commits into
Open
Conversation
FRED carries no palm kernel oil series, so this targets palm oil (PPOILUSDM, IMF monthly, USD/tonne, 414 observations). See DATA.md for the full survey and the open decision on the commodity. FREDAdapter approximates released_at = timestamp, which would expose a monthly price up to 42 days before it was published — a leak at every origin in a monthly backtest. data.py fetches each observation's true first-publication date from FRED's real-time archive (output_type=4) and registers the corrected frame, so CutoffEnforcer withholds each price until FRED actually released it. - scripts/explore_fred_oils.py: FRED catalogue survey + publication-lag measurement, excluding archive backfills that would distort the lag - implementations/pko/data.py: build_palm_oil_service() with honest released_at; verified June 2026 first appears at a 2026-07-13 cutoff - implementations/pko/plots.py: five interactive Plotly charts on the validated categorical palette, with direct labels where contrast needs relief - implementations/pko/01_pko_data_exploration.ipynb: executed tour of the series, the 7 candidate cutoffs, and the information gap - implementations/pko/DATA.md: shareable survey write-up Two publication blackouts matter for cutoff choice: Dec 2021–Aug 2022 (covering the Indonesian export ban) and Jul 2025–Jan 2026. All 7 candidate cutoffs sit at a 2-month information gap so they stay comparable.
Khashayarbayati1
force-pushed
the
unilever
branch
from
August 6, 2026 19:38
4dd9787 to
5845251
Compare
FRED's monthly palm oil price is published ~2 months late and stopped entirely for six months twice, which caps the newest usable forecast origin at 2025-08 and rules out weekly news alignment. The daily CME Crude Palm Oil settlement price (Yahoo CPO=F) has no publication lag — timestamp is the release date — so it reaches 2026 origins and supports weekly GDELT matching. Registers two series off one fetch: palm_oil_futures_daily (3,916 rows, 2010-05 onward) and palm_oil_futures_weekly (814 Friday closes). The weekly grid is complete since 2017 — 500 of 500 expected Fridays — so weekly forecast dates resolve under the harness's exact-timestamp match. The FRED service and its release-date handling are unchanged, and remain useful as a monthly cross-check. KNOWN ISSUE — not yet fixed. CPO=F carries a monthly contract-roll artifact: 19 of the 20 largest daily moves since 2017 fall on the first trading day of a month, averaging 3.57% against 0.68% on other days (5.2x). Cross-checking against FRED confirms these are partly synthetic — April 2022 shows -12.78% in CPO=F but only -2.40% month-over-month in FRED. The effect is specific to this contract, not to Yahoo's futures handling generally (CL=F measures 1.0x with no clustering). A 4-week forecast window spans one roll, so returns and volatility are contaminated and a baseline is penalised for missing non-economic jumps. Resolve before selecting cutoffs — either roll-adjust the series, use monthly averages of the daily data, or confirm the intended MPOB source. Caveats are documented inline above the new section.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Clickup Ticket(s): Link(s) if applicable.
Type of Change
Changes Made
Testing
uv run pytest tests/)uv run mypy <src_dir>)uv run ruff check src_dir/)Manual testing details:
Screenshots/Recordings
Related Issues
Deployment Notes
Checklist