I try to write a small "program" that gets the stock prices from Quandl. The user should be able to enter a startring date (yyyymmdd) and the the program should then get the data from that date and forward to current date.
import datetime as dt
import pandas_datareader as web
ticker = 'TSLA'
# Time variables for current and starting date as integers
current_year = int(dt.datetime.now().strftime("%Y"))
current_month = int(dt.datetime.now().strftime("%m"))
current_day = int(dt.datetime.now().strftime("%d"))
start_date = str(input("Starting date (yyyymmdd): "))
start_year = int(start_date[:4])
start_month = int(start_date[5:6])
start_day = int(start_date[7:8])
# Defines the total period
start = dt.datetime(start_year, start_month, start_day) # Starting date, yyyy mm dd
end = dt.datetime(current_year, current_month, current_day) # End date, yyyy mm dd
# Gets the data from start to end date for the stock definded as 'Ticker'
df = web.get_data_quandl(ticker, start, end)
print(start)
print(end)
print(df)
My problem is that I cannot seem to get any data newer than 2018-03-27.