Data-mining the average sp9 May 2019 17:17
There is some wonderful historical data at uk.finance.yahoo.com to be data-mined.
For example, it is interesting to look at the average share price over a year. Here is a linux (bash) script to do that:
#!/bin/bash
echo -n "20${1}: "
j0=$(date -d "20${1}0101 0000" +%s)
j1=$(date -d "20${1}1231 2359" +%s)
curl -s "https://uk.finance.yahoo.com/quote/SXX.L/history?period1=${j0}&period2=${j1}&interval=1d&filter=history&frequency=1d" | tr ',' '\n' | grep adjclose | tr -cd '\n.0123456789' | awk '{s+=$1;};END{print NR" working days, ave sp "s/NR;}'
(I'll explain how it works if anyone asks). You run this script by giving it a 2-digit year as an argument. Here is the result of running it as far back as records go.
2005: 110 working days, ave sp 6.26591
2006: 252 working days, ave sp 4.67738
2007: 253 working days, ave sp 5.28577
2008: 254 working days, ave sp 2.93986
2009: 253 working days, ave sp 4.96403
2010: 253 working days, ave sp 5.46285
2011: 252 working days, ave sp 13.7103
2012: 251 working days, ave sp 19.8127
2013: 253 working days, ave sp 18.7764
2014: 253 working days, ave sp 11.8583
2015: 253 working days, ave sp 15.0087
2016: 253 working days, ave sp 22.6206
2017: 252 working days, ave sp 24.8372
2018: 253 working days, ave sp 28.5084
2019: 88 working days, ave sp 20.2758
Can we beat last year's average (28.5 p) this year?