# Why SPY gaining value overnight?

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

• The flow of information that moves security prices does not stop simply because the repective exchange is closed. The new information that enters the market during the overnight period manifests in opening prices that differ from the closing. Commented Mar 8, 2017 at 18:07
• Ah do I get this right? Let's say positive news and open clearly higher than the close day before and vise verse for negative news and my model looking at interday Open to Close only looks at the change within that day. Commented Mar 8, 2017 at 18:11
• Exactly. Or the Asian markets trading higher resulting in the European opening being up as well. Commented Mar 8, 2017 at 18:12
• Simply said, you can buy/sell stock that contributes the an index even after the exchange is closed (think out-of-hours trading). There may not be enough liquidity as when during the normal trading hours, but there are still traders ready to sell/buy, orders are procesed. And those trades will impact the index, futures on the index, options etc. See, e.g. ig.com - they have index prices even after the exchanges close.
– rbm
Commented Mar 8, 2017 at 19:21

## 1 Answer

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?

By summing Close - Open for each day you are missing several things: (1) dividends, (2)fund expense fees and (3)any other fees associated with the fund (4) extended hours trading.

Using Close - Previous Close will capture dividend accruals as well as any fund expense accruals and any gap openings that are the result of extended hours trading.