Using the TensorFlow RNN API for stock price prediction
First, you need to claim your free API key at https://www.alphavantage.co so you can get stock price data for any stock symbol. After you get your API key, open a Terminal and run the following command (after replacing <your_api_key>
with your own key) to get the daily stock data for Amazon (amzn) and Google (goog) or replace them with any symbol of your interest:
curl -o daily_amzn.csv "https://www.alphavantage.co/query?function=TIME_SERIES_DAILY&symbol=amzn&apikey=<your_api_key>&datatype=csv&outputsize=full" curl -o daily_goog.csv "https://www.alphavantage.co/query?function=TIME_SERIES_DAILY&symbol=goog&apikey=<your_api_key>&datatype=csv&outputsize=full"
This will generate a daily_amzn.csv
or daily_goog.csv
csv file with the top line as "timestamp, open, high, low, close, volume" and the rest of the lines as daily stock info. We only care about the closing prices so run the following...