I am just getting started with Quantopian Research and having trouble understanding what the returns
function is doing exactly..
In the notebook, I have SPY open, close, daily_return and close2
column.
open, close, daily_return
is calculated using the API prices()
and returns
functions
close2
is calculated as open * (1 + daily_return)
-- it should theoretically match up with the close
price reported by Quantopian, but you can see it doe not. In some days the daily_return
is negative even though the price moves up.
What is the quantopian.research.returns
function is doing, and why doesn't it match up?