How to Get Stock Data & Export It To Excel Using Python | Tutorial [EASY] ๐Ÿ’ป

preview_player
ะŸะพะบะฐะทะฐั‚ัŒ ะพะฟะธัะฐะฝะธะต

๐——๐—˜๐—ฆ๐—–๐—ฅ๐—œ๐—ฃ๐—ง๐—œ๐—ข๐—ก
โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€
In this tutorial, I will show you, how you can retrieve Stock information and export it to Excel by using Python with the help of the pandas datareader library.

[๐Ÿ”ฅ ๐—ฃ๐—Ÿ๐—˜๐—”๐—ฆ๐—˜ ๐—ก๐—ข๐—ง๐—˜ ๐Ÿ”ฅ]
The method used in the video does not work anymore.
I have adjusted the code accordingly. In the code below, I am using the 'yfinance' library to pull the stock data. You can install the library by typing 'pip install yfinance' in your command prompt/terminal.

๐Ÿšฉ HERE IS THE CODE [Updated Version]:
import yfinance as yf # pip install yfinance
import pandas as pd # pip install pandas

start = "2020-01-01"
end= "2020-07-31"
tickers = 'GOOG TSLA MMM'

start=start,
end=end)

๐—ง๐—ข๐—ข๐—Ÿ๐—ฆ ๐—”๐—ก๐—— ๐—ฅ๐—˜๐—ฆ๐—ข๐—จ๐—ฅ๐—–๐—˜๐—ฆ
โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€

๐—–๐—ข๐—ก๐—ก๐—˜๐—–๐—ง ๐—ช๐—œ๐—ง๐—› ๐— ๐—˜
โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€โ–€

โ˜• ๐—•๐˜‚๐˜† ๐—บ๐—ฒ ๐—ฎ ๐—ฐ๐—ผ๐—ณ๐—ณ๐—ฒ๐—ฒ?
ะ ะตะบะพะผะตะฝะดะฐั†ะธะธ ะฟะพ ั‚ะตะผะต
ะšะพะผะผะตะฝั‚ะฐั€ะธะธ
ะะฒั‚ะพั€

Hi, I'm looking at some of your tutorials and I found them very interesting.
I am currently working on a trading algorithm in Python that updates the information every 10 seconds, which I have almost solved but I need to execute my algorithm with a macro in Excel. Do you have a tutorial that talks about this topic?

germanlago
ะะฒั‚ะพั€

thank you for sharing your knowledge, would like to ask if you can do a Vid on creating APIs or if you can direct me to what you find the best for doing so. again thank you

geetabares
ะะฒั‚ะพั€

Thanks a lot. Is it possible to get the option price of any expiration date using this method?

kumarprabs
ะะฒั‚ะพั€

Just FYI, "pip install openpyxl" might be needed for creating the excel file if there is a missing module error after running. Otherwise, great job, thank you.

maryl
ะะฒั‚ะพั€

Hi
We can pull the price data from different stock exchanges rather than Yahoo? If yes, can you show us how to pull the live prices from exchanges

nareshrupela
ะะฒั‚ะพั€

Is there a way to also look up the value of the options chain? Particularly the ATM options?

realazduffman
ะะฒั‚ะพั€

I swear, one day i will get rid of the Bloomberg terminal. Ty Sven!

PaulPetta
ะะฒั‚ะพั€

Great video! How could this be modified to get monhly returns instead of dailty returns?

srengodbersen
ะะฒั‚ะพั€

Hello ! I have parse data with my python file and getting the result in python console, now I want to export this data to google sheet. Can you help me to do that ?

ksmiff
ะะฒั‚ะพั€

Thanks for the video. How to get the data for other time frames like hourly, 30 minutes etc?

ssrwarrior
ะะฒั‚ะพั€

Curious if you need openpyxl or xlwings for this to work?

brianrooney
ะะฒั‚ะพั€

Hi i keep getting a module not found error: no module named 'pandas data_reader'. Im confused because i do have pandas datareader installed. this is preventing me from forming the excel file. Any ideas how to fix it?

soggynutz
ะะฒั‚ะพั€

Thank you for the video, it was very helpful. Many people seem to forget that they already learned Python, and some may not know any at all. You were very descriptive, and the code was the absolute bare basics, which was exactly what I needed to understand why I was typing the words and characters that are needed for this script. Now I can take this an hopefully learn to expand upon it.
Say I wanted to add in a condition. Say I wanted to only include the stocks that had relative volume of 4.0 or higher, and were trading above 50 Simple Moving Average. How would I do that, and where would I include this in the code? I know I'm probably asking to much, so If you want to (and would be so kind as to just tell me where this go in the code you provided and I'll be able to look up how to do it and what to type. Unless of course you wouldn't mind telling me. Seriously, you have helped me very much. Thanks.
Tip: OXY Calls, try to get Jan 15th exp, but only to hold for maybe 2-3 days. I have already made a few hundred and just got them This past Friday.

stevenprentice
ะะฒั‚ะพั€

Is it possible to use this to get an economic calendar output to excel?

camtomsmith
ะะฒั‚ะพั€

does this work in the same way on a mac computer?

lzra
ะะฒั‚ะพั€

Hi, I think there was an update from yahoo so this does not work anymore. can you fix it?

joyflow
ะะฒั‚ะพั€

Why you wrote that it doesn't work ? I did like in video and i got the same data as by yfinance

kaseox
visit shbcf.ru