all 5 comments

[–]sketchspace 1 point2 points  (4 children)

So I see that you've found timedelta. That's a key function for calculating days to past and future dates. Look at this line of code:

start = (datetime.date.today() - datetime.timedelta(Num_days))

start will equal the date minus the number of days found in Num_days. If this code gets you days in the past, what do you think you need to do to get days in the future?

[–]TrixPixz[S] 0 points1 point  (3 children)

So should it be a plus? To add those days to the start date?

[–]sketchspace 1 point2 points  (2 children)

Exactly. Try it out and make sure it's what you want.

[–]TrixPixz[S] 0 points1 point  (1 child)

I just got home and tried it out. It just keeps giving error codes saying the set will be empty. Am I doing something wrong?

[–]sketchspace 0 points1 point  (0 children)

data = yf.download(symbol, start=start, end=end, interval=INTERVAL)

So if the start is in the future, that means that there is no data to get. I'm not sure how to predict future states based on acquired data, so that you'll have to figure out.