You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In docs you state that the returns are computed as change between the next day and current day, i.e. r_t = p_{t+1} / p_{t} - 1 but in the examples you use Panda's pct_change() which is the difference between current and previous day. I assume just doing pct_change() on prices is the correct way?
Thanks
The text was updated successfully, but these errors were encountered:
Which example are you referring to? The old paper examples are not cleaned and might have issues, as it's stated in the docs. In the library, returns at time t are computed as adjusted open price at time t+1 divided by adjusted open price at time t, minus 1, as is described in the paper. Adjusted means that dividends are incorporated in the price changes, it's a technical detail that's also mentioned in the paper (if you dig). The reference implementation is in the cvxportfolio/data module. If you find issues there please report. There's also a ton of logic for cleaning Yahoo Finance historical data there. If you wish to use your own data, just make sure you define returns as they are in the paper.
In docs you state that the returns are computed as change between the next day and current day, i.e. r_t = p_{t+1} / p_{t} - 1 but in the examples you use Panda's
pct_change()
which is the difference between current and previous day. I assume just doingpct_change()
on prices is the correct way?Thanks
The text was updated successfully, but these errors were encountered: