Skip to content

Adopt versioned calendar selection through Engine, feed and results #151

Closed

Description

@stefan-jansen

Problem

The next Backtest temporal-contract version must preserve explicit calendar selection using the shared Specs v2 API. Current public Engine behavior conflates calendar=None with omission and feed inheritance.

Reproduction at e74bed7

  • Explicit calendar=None with NYSE feed metadata and enforce_sessions=True drops a Saturday observation and serializes NYSE.
  • Omitting calendar without metadata keeps Saturday and resolves None rather than the confirmed NYSE fallback.
  • Calendar-free hourly Engine results annualize at 1638 periods/year (252 times 6.5).
  • Daily EVENT_TIME drops a valid Sunday-evening CME observation retained by hourly EVENT_TIME.

Accepted next-version contract

Use canonical calendar across APIs/config/serialization, resolving explicit argument then declared metadata then NYSE. Explicit None means observation mode, distinct from a continuous schedule. New configs adopt temporal v2; legacy payloads remain readable without silently relabeling old null values. Preserve config/feed/result round trips and explicit timestamp semantics. Use a documented 252-observation numerical convention in row mode, with a positive finite annualization override.

Dependency and release boundary

Specs v2 is merged at immutable commit 701bde68744035050ede386efce498234c661c21; qualification must use that source. PyPI 0.1.5 does not provide this API. Keep the pending 0.1.13 candidate unchanged and implement on a separate next-version branch. No publication or deployment is part of this issue.

Verification

Real public Engine regressions must fail on the base and pass on the fix, including metadata, explicit None, omission, JSON/YAML/copy round trips, irregular timestamps, scale overrides and daily CME event-time handling. Run focused source/installed workflows and applicable hosted checks; retain exact revisions and unresolved full-qualification evidence.

AI assistance

Codex reproduced the public Engine behavior and prepared this issue and implementation checks under maintainer direction.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions