Python for Finance #1 - Introduction and Getting Real Time Stock Data

  Рет қаралды 128,633

eMaster Class Academy

eMaster Class Academy

Күн бұрын

Пікірлер: 104
@mattrading8701
@mattrading8701 3 жыл бұрын
definetly the best starter video for python for finance! thanks
@faridparvez
@faridparvez Жыл бұрын
Great video, very clear. Please make a video on roadmap to learning python from scratch, specifically for stock analysis, chart analysis, getting trade signals using charts and statistical analysis of stocks. I mean create a roadmap on the course tailored cut for only stock analysis . Regards Farid
@chuhoting88
@chuhoting88 2 жыл бұрын
Otherwise this also works - My(6px) Pos(r) smartphone_Mt(6px) W(100%). I noticed the class ID currently on the page today is slightly different from what we have in the video.
@bhargav7476
@bhargav7476 3 жыл бұрын
Great content! Can you please provide the source code for entire project?
@anandrapaka2123
@anandrapaka2123 Жыл бұрын
@eMasterClassAcademy can you please share the jupyter notebook of this video ? for somereason the copy pasted class code from inspect of Yahoo page is not working correctly for me. I would like to refer to your code and find where I am going wrong
@ambientsoda106
@ambientsoda106 Жыл бұрын
Thank God, the Devil or the Light (which ever your into) for this tutorial series amazing content to share thank you so much...
@rickcheung1431
@rickcheung1431 3 жыл бұрын
Excited to see more! Thanks
@adghannam2107
@adghannam2107 Жыл бұрын
guys i get this thing ([], []) what should i do
@patrickjay6434
@patrickjay6434 2 жыл бұрын
Excellent, thanks for sharing
@eMasterClassAcademy
@eMasterClassAcademy 2 жыл бұрын
Thanks for watching!
@SanjayRaut-l4v
@SanjayRaut-l4v 9 ай бұрын
nice one, thanks
@nakatainuw0218
@nakatainuw0218 Жыл бұрын
does the code work for you ? I think Yahoo finance made some change on the div class since this video is post. please let me know
@messymagic1373
@messymagic1373 10 ай бұрын
Yes, exactly
@fdrakr101
@fdrakr101 7 ай бұрын
@@messymagic1373 Hey were you able to figure out the div class?
@messymagic1373
@messymagic1373 7 ай бұрын
@@fdrakr101 He made an updated video, check that out.
@colinmaharaj
@colinmaharaj Жыл бұрын
I'm more into C++ Builder and Delphi. I got a library to make connections to IB. I plan to connect to alpaca in the future
@ambientsoda106
@ambientsoda106 Жыл бұрын
how did you even know how to do this? brilliant tutorial.
@janehon485
@janehon485 3 жыл бұрын
Looks very nice the setting. Thanks!
@elibrignac8050
@elibrignac8050 Жыл бұрын
Would it be possible to link the GitHub repo for this?
@oscarchandra9962
@oscarchandra9962 2 жыл бұрын
Great video! thanks! :D
@eMasterClassAcademy
@eMasterClassAcademy 2 жыл бұрын
Thank you too!
@financeunlimited8118
@financeunlimited8118 3 жыл бұрын
Looking forward to seeing more! Thanks you sir!
@mahenkul64
@mahenkul64 2 жыл бұрын
Hi, I tried this code, however I got [ ], [ ] as output for NSE stock. Is there anything that I need to change in code for Indian Stocks?. Please advise. Thanks.
@eMasterClassAcademy
@eMasterClassAcademy 2 жыл бұрын
Hi Mahendra, thanks for watching the series. Since Yahoo has updated its html at the back end, if you still would like to use Beautifulsoup to capture the data, you need to change a bit of the code. Please see the updates from #17-18 kzbin.info/www/bejne/d2q1m2pteLCjgJo However, I would also recommend to use Selenium which is more stable (but slower). Please also see the updates from #19-21 kzbin.info/www/bejne/Y4a5p5aFg7OnbpI Here I assumed Yahoo has stock data for India. Hope it helps.
@dbrader8426
@dbrader8426 3 жыл бұрын
I cannot seem to find the error as I have check all syntax over and over vs yours but I keep getting this error when I try to run it: Traceback (most recent call last): line 44, in print(real_time_price('BRK-B')) line 33, in real_time_price price, change = texts[0], texts[1] TypeError: 'NoneType' object is not subscriptable
@pucek365
@pucek365 3 жыл бұрын
Try this block of code: if texts != []: price = texts[0] change = texts[1] return price, change Instead what is in video if you are still interested
@rb_420
@rb_420 3 жыл бұрын
@@pucek365 tried and still got the same error here :( line 38, in print(real_time_price('BRK-B')) line 25, in real_time_price price = texts[0] TypeError: 'NoneType' object is not subscriptable
@rb_420
@rb_420 3 жыл бұрын
I figured it out I had a unnecessary space in the return function: def web_content_div(web_content, class_path): web_content_div = web_content.find_all('div', {'class': class_path}) try: spans = web_content_div[0].find_all('span') texts = [span.get_text() for span in spans] except IndexError: texts = [] *****(space that was not supposed to be here) return texts
@tuvshuutuvshuu4447
@tuvshuutuvshuu4447 2 жыл бұрын
('-0.81', '(-0.26%) mine is just showd this. how to show price
@yazifjamaludin7363
@yazifjamaludin7363 Жыл бұрын
Could you share the code file?
@chuhoting88
@chuhoting88 2 жыл бұрын
Just tried this out and was only able to return the data when using 'My(6px)' instead of what's in the video
@rohanvkumarv
@rohanvkumarv 2 жыл бұрын
I don't why but connectionEroor and requestsexcpetion it is showing these modules are not found
@ericbader7998
@ericbader7998 2 жыл бұрын
Great video for parsing real time data off a website. How and where would you extract old stock prices from yesterday, last month or last year?
@eMasterClassAcademy
@eMasterClassAcademy 2 жыл бұрын
Thanks for watching Eric. For historical data, I am using polygon.ai to download. Details can’t be found in lesson 8 in this series- kzbin.info/www/bejne/f5e4g2SOf8aAmck
@kyleryxn
@kyleryxn 2 жыл бұрын
For some reason, my code only returns the price change and percent change and doesn't include the current price. How can I fix this? please post a link to source code
@martinwendling6673
@martinwendling6673 2 жыл бұрын
same issue
@jameskaddissi6600
@jameskaddissi6600 2 жыл бұрын
Ok, here's the answer. Basically yahoo finance changed their html code. I had to look back through it, but the 'span' class which we are searching through is only used for displaying the price change and percent change. The easy fix is to change the line spans = web_content_div[0].find_all('span') to spans = web_content_div[0].find_all('fin-streamer'). If you make that change and run it, it will return the price and price change, because you are only looking for the first two bits of data. If you also want the price change you have to add a third array [], so rather than price, change = [], [] you have to make it price, change, pct = [], [], [] for every line where you see that.
@jameskaddissi6600
@jameskaddissi6600 2 жыл бұрын
@@martinwendling6673 see my reply to OP
@ahn19c
@ahn19c 2 жыл бұрын
@@jameskaddissi6600 😀
@markboweringphotography4408
@markboweringphotography4408 2 жыл бұрын
@@jameskaddissi6600 thank you so much for this. I was struggling to get this working.
@Kaustubh56
@Kaustubh56 9 ай бұрын
Yahoo Finance data is showing, but the values are incorrect. What to do?
@Tutordidi
@Tutordidi Жыл бұрын
Thank you so much for this tutorial!
@domenicperito4635
@domenicperito4635 Жыл бұрын
so i tried scraping tesla and its not a span its a fin streamer, and the percent change is 2 seperate elements. this did not work.....thankfully gpt4 wrote the code for me........
@ravimeena489
@ravimeena489 2 жыл бұрын
i am not able to copy this inspect element path how i can please help me
@creatorfans6357
@creatorfans6357 3 жыл бұрын
Thanks a lot. Are you going to do any prediction?
@kelvinstones979
@kelvinstones979 3 жыл бұрын
I am so happy about this .I just received a transfer of 38000usd all thanks to thechinahacks
@BOSprodz
@BOSprodz 2 жыл бұрын
ignore all scams of this kind please. there is no easy/guaranteed money
@SMCGPRA
@SMCGPRA Жыл бұрын
How to get for India NSE data
@hcapital8993
@hcapital8993 2 жыл бұрын
cannot find the element in the url how to solve that problem??
@investingpearl6440
@investingpearl6440 Жыл бұрын
bro make a video on intraday moneyflow analysis of future and option
@Cubear99
@Cubear99 3 жыл бұрын
I give up. do i need a different version of python ?? I am using 3.8.1
@saharamanson1970
@saharamanson1970 3 жыл бұрын
i think site is updated [it do not allow web scraping] not working for me bro . if it is working for u please send me the code
@andrewsnowdon2845
@andrewsnowdon2845 2 жыл бұрын
@@saharamanson1970 It is scrapable by other means but I keep getting no values returned using this method
@janjamniksrpcic4517
@janjamniksrpcic4517 2 жыл бұрын
@@andrewsnowdon2845 I have the same problem
@munivoltarc
@munivoltarc Жыл бұрын
can u do on indian NSE stock market ?
@RashidAli-ok3yv
@RashidAli-ok3yv 2 жыл бұрын
Hi, im getting SyntaxError: unexpected EOF while parsing issue while executing the file. please help
@maximiliankrug1011
@maximiliankrug1011 3 жыл бұрын
any Idea why pd.to_excel overwrites the first row over and over again? I've tried it with pd.to_csv but when I use transpose() it starts writing all the info in the first column and doesn't come to the next.
@andrewsnowdon2845
@andrewsnowdon2845 2 жыл бұрын
When I do this the spacing in the web_content_div(web_content, '' ') bit stops me from printing out the price, it only allows me to do the percentage change? Is there anyway around this. If i use that full smartphone bit i get nothing
@andrewsnowdon2845
@andrewsnowdon2845 2 жыл бұрын
string sorry lol
@TheDarkskullMr
@TheDarkskullMr 2 жыл бұрын
How did you resolve the problem?
@silasbucur685
@silasbucur685 18 күн бұрын
This no longer works (it loops [] [] [] []). I wonder WHY does this need to be updated for stocks. For example, you made a previous video with different code. Why does it have to change over time?
@atultanna
@atultanna 2 жыл бұрын
Is center pivot point included
@victorgc44
@victorgc44 Жыл бұрын
its not reading the first span. It´s always jumping for the next. In resume its reading only the change, not the price.
@atultanna
@atultanna 2 жыл бұрын
We are from India so what time stamp would we insert
@jokehuang1611
@jokehuang1611 3 жыл бұрын
How did you do live plotting?
@atultanna
@atultanna 2 жыл бұрын
How do we get different time frames
@francescovitale44
@francescovitale44 2 жыл бұрын
couldn't you use the yfinance api ?
@mrjetranger123
@mrjetranger123 Жыл бұрын
the yahoo fin page does not have a span around the data, its now a class.
@renyuanceshi73
@renyuanceshi73 3 жыл бұрын
Thx!
@eeshanchanpura3356
@eeshanchanpura3356 2 жыл бұрын
Do you have anything regarding stock option simulator thing?
@eMasterClassAcademy
@eMasterClassAcademy 2 жыл бұрын
Hi Eeshan, thanks for your questions. This is indeed one of the projects in my plan. Although it is not yet out, it's not difficult to do so as long as you can have enough target data (e.g. minutes data of certain stock / index / option) for simulation. 1) For data, here is a video to show how we can retrieve 2 years of data at 1 min interval - kzbin.info/www/bejne/f5e4g2SOf8aAmck 2) For backtesting, you can find details from python #8 - #16 - kzbin.info/www/bejne/oYjQqJaHfsiIgrc 3) For simulation, you can follow the lessons #22 - #29 - kzbin.info/www/bejne/mYfRpYqGaMSSg9k and simply change this line of code: filename = str(time_stamp) + ' stock data.csv' At the same time, you need to create a separate py. program which appends the data one by one from the data retrieved by 1) in a csv with filename in 3). Hope it helps. Let me create a video to show you how to create a separate program for appending data in a defined csv file later.
@eeshanchanpura3356
@eeshanchanpura3356 2 жыл бұрын
@@eMasterClassAcademy thanks a lot this help a loads
@shaynegoldstein1329
@shaynegoldstein1329 3 жыл бұрын
Can somebody who has it working just give me the code. I don't understand what to copy and past because he just kind of did it.
@brandonsardelli7456
@brandonsardelli7456 2 жыл бұрын
Source code available?
@eMasterClassAcademy
@eMasterClassAcademy 2 жыл бұрын
Thanks for watching. Code and materials are available to members (level 2 or 3).
@isaacshadrach7683
@isaacshadrach7683 2 жыл бұрын
can anyone help my source code returns and empty [] []
@eMasterClassAcademy
@eMasterClassAcademy 2 жыл бұрын
You need to check if you retrieve something from the “div” content first. If yes, then you can find out the “span” that capture the required data. If not, then the “div” doesn’t return you any values. You might need to switch to other “div” or find other sources. Make sure there is no typo. Happy web scraping!
@isaacshadrach7683
@isaacshadrach7683 2 жыл бұрын
@@eMasterClassAcademy i used `'My(6px)'` as the path and it worked. can you explain why? also can i get any of your social media handle to follow and chat you up sir.
@isaacshadrach7683
@isaacshadrach7683 2 жыл бұрын
@@eMasterClassAcademy Also my results looks this `('-4.61', '(-1.43%)') `is that ok?
@elijahachiri
@elijahachiri 2 жыл бұрын
@@isaacshadrach7683 Yeah It wasn't working for me then I tried it as 'My(6px)" and it just worked
@jay-dj4ui
@jay-dj4ui 2 жыл бұрын
Did you fix that? I have same issue with empty( [ ], [ ] )
@luck13406
@luck13406 3 ай бұрын
Hong Kong 您好,我是來自台灣STEVEN 能否轉帳給你得到你的原始碼, 謝謝
@eMasterClassAcademy
@eMasterClassAcademy 3 ай бұрын
你好, 所有原始碼都提供給這頻道KZbin 會員 (級別2或以上). 希望幫助到你.
@nakulanand6324
@nakulanand6324 Жыл бұрын
BRO CAN I GET THE SOURCE CODE
@Jason-ru7xt
@Jason-ru7xt 3 жыл бұрын
Awesome content ! would like to know how frequent can I access the data, whether yahoo will detect as bot and ban my IP?
@lennard4454
@lennard4454 2 жыл бұрын
more important are open, high, volume, .... in interval such as 5 min, 15 min, .... this is basically useless
@Hizan2411
@Hizan2411 3 ай бұрын
Que hpta video tan melo
@rohanaggarwal8718
@rohanaggarwal8718 Жыл бұрын
idk why it's so hard to follow along with this guy, like he is just coding, instead of trying to teach. Take step back explain what you are making and explain your var names!!
@ayyappajith3909
@ayyappajith3909 Жыл бұрын
Vro did u get any typeerror
@clickkode
@clickkode 3 жыл бұрын
Hi, thanks for the video. How do I set up PyCharm the way you have sr?
@deanemarks8611
@deanemarks8611 3 жыл бұрын
Hey man I'm now too. The first part is make sure in your virtual environment you have the right packages installed.... So basically file new project.... You are basically making a new environment that is blank... then when you get in pycharm to a text editor look near the bottom.. there is "python packages". you have to install all the packages he uses like pandas, beautiful soup, requests etc. from there make sure you "configuration" is set up to the file you are currently working on or basically you cant run anything in pycharm.... Kind of stupid how that works, but if you get that set up right, now your fishin with Dynamite brotha!
Python for Finance #2 - Getting and Storing Multiple Real Time Stock Data
22:07
eMaster Class Academy
Рет қаралды 29 М.
Technical Analysis with TradingView in Python
9:53
NeuralNine
Рет қаралды 38 М.
Turn Off the Vacum And Sit Back and Laugh 🤣
00:34
SKITSFUL
Рет қаралды 11 МЛН
Мен атып көрмегенмін ! | Qalam | 5 серия
25:41
Deadpool family by Tsuriki Show
00:12
Tsuriki Show
Рет қаралды 7 МЛН
Что-что Мурсдей говорит? 💭 #симбочка #симба #мурсдей
00:19
Симбочка Пимпочка
Рет қаралды 4,6 МЛН
Stock Chart Analysis with GPT4o Omni (Python Tutorial)
8:41
Part Time Larry
Рет қаралды 203 М.
Predict The Stock Market With Machine Learning And Python
35:55
Dataquest
Рет қаралды 727 М.
Technical Stock Analysis Made Easy in Python
29:47
NeuralNine
Рет қаралды 69 М.
Python Web Scraping Tutorial - Automate Stock Market Data Collection
15:33
LAVROV's interview with Tucker CARLSON 😁 [Parody]
8:34
Юрий ВЕЛИКИЙ
Рет қаралды 382 М.
Predicting Stock Prices in Python
29:14
NeuralNine
Рет қаралды 540 М.
Introduction to Python for Finance
25:27
Richard Moglen
Рет қаралды 201 М.
Financial Data with Python: yfinance
34:09
Data Science for Everyone
Рет қаралды 76 М.
Turn Off the Vacum And Sit Back and Laugh 🤣
00:34
SKITSFUL
Рет қаралды 11 МЛН