-
Notifications
You must be signed in to change notification settings - Fork 632
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
Question about applyPtSlOnT1 #4
Comments
what is the column "side" about ? Note:- loc is a timestamp !!! |
Yes, this is my understanding. Side represents long as 1 and short as -1. The side parameter is the prediction of the first step of the algorithm. It is used in the meta-labeling part (second step). However, I don't understand why it's necessary to multiply by it when the returns are computed. |
@ivan-vasilev a positive return is only beneficial if you're long. If you're short it's a negative outcome. The reverse is also true, a negative return is only beneficial if you're short. If you're long it's a negative outcome. The side is a binary variable indicating whether you are long or short. Example:
|
In the method [3.2] applyPtSlOnT1, there is:
df0=(df0/close[loc]-1)*events_.at[loc,'side'] # path returns
This line is the same as in the book, however what is the point of multiplying the returns by the predicted side:
*events_.at[loc,'side']
? Wouldn't this change the sign of the returns and thus create an error when the barriers are computed on the next line? I know this is not a bug, so I'm sorry about asking here.The text was updated successfully, but these errors were encountered: