Skip to content

Conversation

bravegag
Copy link

@bravegag bravegag commented Feb 26, 2025

Fixes #963

The issue is fixed by doing a ffill prior to the bfill so that bfill will only be applied to leading NAs, this way makes it possible to compute holding period return (HPR) from p[0] if needed. The ffill and bfill were moved prior to the rolling step to make sure there are no NAs and therefore adding the min_period=1 to the rolling function is unnecessary.

@kernc kernc changed the title Implementation for issue #963 Fix ATR look-ahead bias Mar 11, 2025
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.

ATR introduces look-ahead bias
1 participant