Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

prets incorrectly defined #2

Open
Lukehi opened this issue Mar 13, 2023 · 0 comments
Open

prets incorrectly defined #2

Lukehi opened this issue Mar 13, 2023 · 0 comments

Comments

@Lukehi
Copy link

Lukehi commented Mar 13, 2023

data['prets'] = (data['pmodel'] * data['target_rets']).shift(1) # Lag by 1 to remove look ahead and align dates

The following line does not seem to be correct. It is supposed to specify the returns of a trading rule which is the sign of the previous day. However, it sets negative previous days in 'pmodel' to 0. This means the strategy returns 'prets' is long only.

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

No branches or pull requests

1 participant