Skip to content

Fix ATR look-ahead bias #1230

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Fix ATR look-ahead bias #1230

wants to merge 1 commit into from

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
# for free to join this conversation on GitHub. Already have an account? # 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