Robert Shiller on the New York Times argues that the stock market is expensive by historical standards using the cyclically-adjusted price earnings ratio (CAPE) that he has made popular through his writings since the late 1990s. Prices moves in trends is pretty self explanatory; once a trend has been established, the future price movement has a better chance of following in that same direction. Let’s not forget that a company’s stock price is just as much dependent on investor demand as it is how the company is actually doing. As you most likely already know, a stock opens at a price every morning, fluctuates throughout the day, then closes every evening at a certain price. When looking at a standard (line) chart, if you are looking at it in a time period of over a week then the point on the graph is representative of what the stock closed at for that day.
When on a finance site like Google Finance, you can make the time scale of the graph be anywhere from less than one day to the entire duration of the stock being traded publicly. Fun fact, a chart with a time scale of less than a day is considered an intraday chart. Well here it is – the gateway drug – a few simple lines of code that will let you download Yahoo’s free historical stock price data right into Matlab.
With a little (VERY little) trial & error, you might come to discover that after s= goes the ticker symbol, after a= the start month (minus 1), after b= the start day, c= the start year and so on. The final g= parameter lets you choose between getting historical stock information on a daily, weekly, or monthly basis. Would be nice to add robustness to your code by re-attempting to download the CSV again if not successful the first time. Enter anything lower than 50 and Google Sheets will consider it to be num_days, otherwise it is used as end_date.
The Nasdaq-100 was initiated on January 31, 1985 and quickly became one of the most widely-followed technology indexes during the bubble The chart below (click on the chart for a larger view) illustrates historical annual returns for the Nasdaq-100 index between the calendar years 1986 and 2012. Omit the term altogether and you’ll see data for just one date, the start date quoted.
The Nasdaq-100 Index does not account for dividend payouts, but the Nasdaq 100 Total Return Index, which was initiated on March 4, 1999, does account for dividends. The chart below calculated based on returns for (a) the Nasdaq-100 Index from January 1, 1986 – March 3, 1999; and (b) the Nasdaq-100 Total Return Index from March 4, 1999 – December 31, 2012. However, between 2000 and 2008 the Nasdaq-100 was one of the worst-performing U.S. stock indexes, dropping about 66.48%, an annualized loss of about 11.44%. The Bank of Montreal common share prices constitute historical data and are presented only for information purposes.