ChatGPT Example Extracting Historical Data From Yahoo Finance

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey guys in today's video let's look at how we can get a chat GPT to extract the Yahoo finance data for us and uh they did the data I want is the the closing open high low close data for particular stock um the historical data so you you could find it under Yahoo finance and uh going to the historical data tab okay so yeah let's get chat GPT to give us some code so we'll say please create a python script uh to extract Yahoo Finance all right daily data for a specified uh stop and specify start date and end date and then I wanted to use the y Finance package so because the um data reader package throws an error now after Yahoo finance change their API so okay let's see what um chat GPT can come up for us or you can do okay looks uh yeah it looks about correct so this is a simple one let's copy the code we go to visual studio let's paste that save and then we can run it so this is python demo Dot py and uh yeah as you can see it printed out the close uh from first gen to 21st Feb okay so that's a simple one uh we could get it to do something a bit more complicated so maybe we could say uh let's say uh please extract the data only on days when the vix is above says City okay so what this does is when the vix measures the amount of panic in the market you could say so a vix above 30 usually is an indication that um there is a fair degree of panic so we only want those dates okay so it modified the code and let's copy it place the code that we had earlier save and again we'll type so python demo Dot py as you can see here um so now what it's done is it's extracted the days where the vix was high and as you can see the results are a lot less so between uh 2021 and 2022 there were only let's see one two three four five six seven eight nine now only nine days uh where the vix was that I okay uh so I hope you guys found this useful um to extract Yahoo finance historical data uh some things just to recap is you'd want to use the Y Finance package um so if you don't have that already installed just uh pip install uh why Finance and then you can get your historical stock data okay guys uh see you in the next video bye bye
Info
Channel: Ctrl-Shift-Run
Views: 521
Rating: undefined out of 5
Keywords: chatgpt, python, yahoo finance, data
Id: VghcY_f-ElQ
Channel Id: undefined
Length: 4min 33sec (273 seconds)
Published: Mon Feb 20 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.