Skip to content

feat(generic): add crossed_below_1d_nb and crossed_below_nb - #908

Merged
polakowo merged 2 commits into
polakowo:masterfrom
20163070:feat/nb-crossed-below
Nov 8, 2026
Merged

polakowo merged 2 commits into
polakowo:masterfrom
20163070:feat/nb-crossed-below

Conversation

@20163070

@20163070 20163070 commented Nov 7, 2026

Copy link
Copy Markdown
Contributor

Description

The accessor-level crossed_below() swaps arguments and calls dispatch.crossed_above, but the crossed_below counterpart is missing from the vbt.nb namespace, where users implementing custom signals expect symmetric functions.

This adds:

  • crossed_below_1d_nb — delegates to crossed_above_1d_nb with swapped arrays, so both directions share one code path;
  • crossed_below_nb — 2-dim version for parity with crossed_above_nb;
  • tests covering wait, NaN resets, 2-dim broadcasting, and agreement with the accessor.

Closes #805.

The accessor-level crossed_below() swaps arguments and calls
dispatch.crossed_above, but the crossed_below counterpart was missing
from the vbt.nb namespace, where users implementing custom signals
expect symmetric functions (closes polakowo#805).

crossed_below_1d_nb delegates to crossed_above_1d_nb with swapped
arrays, so both share one code path. Adds crossed_below_nb for 2-d
parity and tests covering wait, NaN resets, and accessor agreement.

@polakowo polakowo left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR! Reusing crossed_above with swapped inputs fits the existing accessor design. The crossover tests pass.

@polakowo
polakowo merged commit 27a3dcc into polakowo:master Nov 8, 2026
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

vbt.nb.crossed_below_1d_nb function

2 participants