I am just learning quantitive finance and most likely missing something really obvious here, but why is S&P500 gaining value outside of trading hours? Or is it?
I took following data from Yahoo Finance API
SPY First Open 2010.1.1 value = 112.370003 SPY Last Close 2017.1.1 value = 223.52999900000003
Last Close - First Open = 111.15999600000004
Next, I created series for daily value change. Series is Close - Open for each day between 2010.1.1 - 2017.1.1
I ran a sum() for my daily change for this time periods.
It's sum of all daily change values and it's value = 73.64011700000037
Why it's not equal to 111.15999600000004?
Below my link to my iPython notebook with the code.
https://nbviewer.jupyter.org/gist/HintikkaKimmo/1ca2fe904eb504641eb7d137976d0208