Repository navigation
feat(generic): add crossed_below_1d_nb and crossed_below_nb - #908
Merged
Merged
Conversation
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
approved these changes
Nov 7, 2026
polakowo
left a comment
Owner
There was a problem hiding this comment.
Thanks for the PR! Reusing crossed_above with swapped inputs fits the existing accessor design. The crossover tests pass.
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.
Description
The accessor-level
crossed_below()swaps arguments and callsdispatch.crossed_above, but thecrossed_belowcounterpart is missing from thevbt.nbnamespace, where users implementing custom signals expect symmetric functions.This adds:
crossed_below_1d_nb— delegates tocrossed_above_1d_nbwith swapped arrays, so both directions share one code path;crossed_below_nb— 2-dim version for parity withcrossed_above_nb;wait, NaN resets, 2-dim broadcasting, and agreement with the accessor.Closes #805.