Created
January 14, 2022 16:52
-
-
Save marcosan93/e00d91c94c394e133472709ac6d73bf3 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 fbpPositions(pred_df, short=True): | |
| """ | |
| Gets positions based on the predictions and the actual values. This | |
| is the logic of the trading strategy. | |
| """ | |
| if pred_df['open'] < pred_df['yhat_lower']: | |
| return 1 | |
| elif pred_df['open'] > pred_df['yhat_upper'] 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