Skip to content

[Bug]: Tick rule loses sign on flat trades, run bars collapse after warm-up, GARCH forecast uses future returns, Roll spread not a window covariance #69

Closed

Description

@quantum-like

Affected library

engineer

Affected package version

0.1.6 (main at a441fb4d)

Environment

Linux, source checkout of main at a441fb4d with the repo's dev environment (uv sync); offline test suite.

Observed behavior

  1. The effective tick rule returns 0 (not the previous sign) for unchanged prices; order-flow imbalance inherits this.
  2. Volume/dollar run bars close on almost every tick after warm-up because the threshold is updated with tick counts.
  3. The GARCH forecast seeds its variance with the next 20 returns.
  4. Roll's spread uses products demeaned by mismatched trailing means.

Expected behavior

  1. Flat trades carry the previous sign. 2. The threshold stays in value units. 3. Only past returns are used. 4. The estimator equals −cov(Δp_t, Δp_{t−1}) over the window.

Minimal reproduction

Each case has a focused unit test on quantum-like/engineer branch review/fixes (one commit per fix, on top of a441fb4d). Every test fails on main and passes with its fix:

  • tests/features/test_microstructure.py::test_effective_tick_rule_carries_previous_sign
  • tests/bars/test_run_bars.py::test_volume_run_expectation_does_not_collapse_to_tick_counts, ::test_dollar_run_expectation_stays_in_dollar_units
  • tests/features/volatility/test_volatility_comprehensive.py::test_forecast_ignores_future_returns
  • tests/features/test_microstructure.py::test_roll_spread_matches_window_covariance
  • covered by existing lookback tests

Compatibility impact

Public behavior or results

Acceptance criteria

Each case has a unit test that fails on main and passes with the fix; Roll's registered warm-up matches its window.

I have a PR ready with these fixes and will link it here.

Amir

Activity

  1. added
    type: bugConfirmed or reported incorrect behavior
    compatibility: affectedHas Python, platform, dependency, or cross-library compatibility impact
    on Oct 7, 2026
  2. stefan-jansen commented on Oct 14, 2026

    @stefan-jansen
    Contributor

    Split into four confirmed, independently reviewable defects: #78 (tick sign), #80 (run-bar units), #82 (GARCH look-ahead), and #84 (Roll covariance). Their focused implementation PRs are #79, #81, #83, and #85; this closure records the split, not completion of the fixes or their release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    compatibility: affectedHas Python, platform, dependency, or cross-library compatibility impactpriority: normalNormal planned workstatus: needs-triageAwaiting maintainer classificationtype: bugConfirmed or reported incorrect behavior

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions