I feel like I'm missing something fundamental here, but I can't shake the feeling that these two series should be equivalent.
/edit: there is also dailyReturn(Cl(SPY)). I've seen all 3 of these methods used to calculate stock returns on various blogs, and I'm wondering which is 'correct.' They all give slightly different results...
/edit2: and there is also Delt(Cl(SPY)), which seems to be equivalent to ClCl(SPY)
Answer
TTR::ROC
calculates log returns by default. quantmod::ClCl
uses quantmod::Delt
, which calculates arithmetic returns by default.
ROC(Cl(SPY), type="discrete")
should match ClCl(SPY)
. Which is 'correct' depends on your purpose.
No comments:
Post a Comment