Skip to content

fix: carry the previous tick sign across flat trades #78

Closed

Description

@stefan-jansen

Engineer 0.1.6 loses the prior trade sign when price does not change. Through the public effective_tick_rule expression, prices [100, 101, 101, 101, 99, 99] should classify as [0, 1, 1, 1, -1, -1]. The affected base a441fb4 instead classifies the flat trades as zero, changing order-flow imbalance.

Reproduce with a Polars DataFrame containing those close values and select effective_tick_rule('close'). A missing price still receives zero. The focused regression test_effective_tick_rule_carries_previous_sign exercises both tick classification and order_flow_imbalance; it fails on the base and passes at f5710e7. The focused microstructure suite passes 23 tests.

This is one of the confirmed defects in #69 and #71. It changes incorrect numerical output and requires a patch release. Original source-fix authorship from Cursor Agent is preserved. Codex assisted review, public-workflow reproduction, verification, and preparation of this focused submission.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions