November 2017
Beginner to intermediate
366 pages
7h 59m
English
We want to build a deep neural network model to predict the movement of certain stocks. The problem is very difficult. Before we move onto building our network, let us look at our data.
To retrieve stock price data, do the following:
> library(ggplot2)> stock.data <- new.env()> tickers <- ('AAPL')> stock.data <- getSymbols(tickers, src = 'yahoo', from = '2000-01-01', env = FALSE, auto.assign = F)
We leverage the package quantmod. The getSymbols function in quantmod can fetch stock information from sources such as Yahoo and Google. As you can see, we are fetching Apple's stock price data using their AAPL ticker.
Let us look at the fetched data:
> data <- stock.data$AAPL.Close> head(data) AAPL.Close2000-01-03 3.9977682000-01-04 ...
Read now
Unlock full access