Created
September 23, 2021 20:06
-
-
Save marcosan93/599da4bda9cc6f6dde43979112ec253c to your computer and use it in GitHub Desktop.
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
| def get_prophet_positions(df, short=True): | |
| """ | |
| For these positions, buy when actual value is above the upper bound and short | |
| when actual value is below lower bound. Otherwise do nothing. | |
| """ | |
| if df['Open'] >= df['yhat_upper']: | |
| return 1 | |
| elif df['Open'] <= df['yhat_lower'] and short: | |
| return -1 | |
| else: | |
| return 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment