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

How does raw_to_Xy() know which column to use to calculate returns #129

Open
SamKimbinyi opened this issue Apr 4, 2022 · 3 comments
Open

Comments

@SamKimbinyi
Copy link

The documentation says

computation of returns (if use_log then logarithmic else simple) - the first timestep is automatically deleted

How does this function know which column is the closing price and therefore which column to use to calculate returns

@jankrepl
Copy link
Owner

jankrepl commented Apr 5, 2022

Hey there! Thank you for your interest.

It is going to compute returns (percentage change) for all the indicators (e.g. open price, close price, volume) that are in the input DataFrame.

Hope that helps.

@SamKimbinyi
Copy link
Author

Thank you for the fast reply!

So if i wish to calculate portfolio returns, would you reccomend creating a dataframe that has the percentage returns from closing prices first?

@jankrepl
Copy link
Owner

jankrepl commented Apr 6, 2022

AFAIK taking the closing prices is the most common approach - I don't really remember the rationale behind it though. However, it is really up to you:)

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

2 participants