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

Поделиться
HTML-код
  • Опубликовано: 27 ноя 2024

Комментарии • 104

  • @mattrading8701
    @mattrading8701 3 года назад +9

    definetly the best starter video for python for finance! thanks

  • @faridparvez
    @faridparvez Год назад +11

    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 года назад +5

    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.

  • @rickcheung1431
    @rickcheung1431 3 года назад +1

    Excited to see more! Thanks

  • @financeunlimited8118
    @financeunlimited8118 3 года назад +3

    Looking forward to seeing more! Thanks you sir!

  • @bhargav7476
    @bhargav7476 3 года назад +21

    Great content! Can you please provide the source code for entire project?

  • @ambientsoda106
    @ambientsoda106 Год назад +1

    Thank God, the Devil or the Light (which ever your into) for this tutorial series amazing content to share thank you so much...

  • @patrickjay6434
    @patrickjay6434 2 года назад +1

    Excellent, thanks for sharing

  • @janehon485
    @janehon485 3 года назад +1

    Looks very nice the setting. Thanks!

  • @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

  • @SanjayRaut-l4v
    @SanjayRaut-l4v 8 месяцев назад

    nice one, thanks

  • @ambientsoda106
    @ambientsoda106 Год назад

    how did you even know how to do this? brilliant tutorial.

  • @anandrapaka2123
    @anandrapaka2123 Год назад +1

    @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

  • @Tutordidi
    @Tutordidi Год назад

    Thank you so much for this tutorial!

  • @oscarchandra9962
    @oscarchandra9962 2 года назад +1

    Great video! thanks! :D

  • @nakatainuw0218
    @nakatainuw0218 Год назад +1

    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.

  • @ericbader7998
    @ericbader7998 2 года назад +1

    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 года назад +1

      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- ruclips.net/video/IfUR1XJaMcg/видео.html

  • @creatorfans6357
    @creatorfans6357 3 года назад +2

    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

  • @adghannam2107
    @adghannam2107 Год назад +2

    guys i get this thing ([], [])
    what should i do

  • @mahenkul64
    @mahenkul64 2 года назад +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 ruclips.net/video/A9Rj77CKpJ8/видео.html
      However, I would also recommend to use Selenium which is more stable (but slower). Please also see the updates from #19-21 ruclips.net/video/-UVvcONNt80/видео.html
      Here I assumed Yahoo has stock data for India. Hope it helps.

  • @elibrignac8050
    @elibrignac8050 Год назад +1

    Would it be possible to link the GitHub repo for this?

  • @silasbucur685
    @silasbucur685 4 дня назад

    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?

  • @dbrader8426
    @dbrader8426 3 года назад +1

    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 года назад +1

      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 года назад +4

      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

  • @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

  • @munivoltarc
    @munivoltarc Год назад

    can u do on indian NSE stock market ?

  • @investingpearl6440
    @investingpearl6440 Год назад

    bro make a video on intraday moneyflow analysis of future and option

  • @renyuanceshi73
    @renyuanceshi73 3 года назад +1

    Thx!

  • @Kaustubh56
    @Kaustubh56 9 месяцев назад

    Yahoo Finance data is showing, but the values are incorrect. What to do?

  • @rohanvkumarv
    @rohanvkumarv 2 года назад

    I don't why but connectionEroor and requestsexcpetion it is showing these modules are not found

  • @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.

  • @RashidAli-ok3yv
    @RashidAli-ok3yv 2 года назад

    Hi, im getting SyntaxError: unexpected EOF while parsing issue while executing the file. please help

  • @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........

  • @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.

  • @hcapital8993
    @hcapital8993 2 года назад

    cannot find the element in the url how to solve that problem??

  • @ravimeena489
    @ravimeena489 2 года назад

    i am not able to copy this inspect element path how i can please help me

  • @kyleryxn
    @kyleryxn 2 года назад +1

    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 года назад +5

      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.

  • @atultanna
    @atultanna 2 года назад

    Is center pivot point included

  • @tuvshuutuvshuu4447
    @tuvshuutuvshuu4447 2 года назад +2

    ('-0.81', '(-0.26%) mine is just showd this. how to show price

  • @jokehuang1611
    @jokehuang1611 3 года назад

    How did you do live plotting?

  • @SMCGPRA
    @SMCGPRA Год назад

    How to get for India NSE data

  • @Cubear99
    @Cubear99 3 года назад +1

    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 года назад +1

      @@andrewsnowdon2845 I have the same problem

  • @mrjetranger123
    @mrjetranger123 Год назад

    the yahoo fin page does not have a span around the data, its now a class.

  • @atultanna
    @atultanna 2 года назад

    We are from India so what time stamp would we insert

  • @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

  • @atultanna
    @atultanna 2 года назад

    How do we get different time frames

  • @francescovitale44
    @francescovitale44 2 года назад

    couldn't you use the yfinance api ?

  • @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?

  • @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.

  • @luck13406
    @luck13406 3 месяца назад +1

    Hong Kong 您好,我是來自台灣STEVEN 能否轉帳給你得到你的原始碼, 謝謝

    • @eMasterClassAcademy
      @eMasterClassAcademy  3 месяца назад

      你好, 所有原始碼都提供給這頻道RUclips 會員 (級別2或以上).
      希望幫助到你.

  • @nakulanand6324
    @nakulanand6324 Год назад

    BRO CAN I GET THE SOURCE CODE

  • @brandonsardelli7456
    @brandonsardelli7456 2 года назад +1

    Source code available?

    • @eMasterClassAcademy
      @eMasterClassAcademy  2 года назад

      Thanks for watching.
      Code and materials are available to members (level 2 or 3).

  • @eeshanchanpura3356
    @eeshanchanpura3356 2 года назад +1

    Do you have anything regarding stock option simulator thing?

    • @eMasterClassAcademy
      @eMasterClassAcademy  2 года назад +1

      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 - ruclips.net/video/IfUR1XJaMcg/видео.html
      2) For backtesting, you can find details from python #8 - #16 - ruclips.net/video/kWmwcQIcULU/видео.html
      3) For simulation, you can follow the lessons #22 - #29 - ruclips.net/video/cVntWP3__Mw/видео.html 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 года назад +1

      @@eMasterClassAcademy thanks a lot this help a loads

  • @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( [ ], [ ] )

  • @Hizan2411
    @Hizan2411 3 месяца назад

    Que hpta video tan melo

  • @lennard4454
    @lennard4454 2 года назад

    more important are open, high, volume, .... in interval such as 5 min, 15 min, .... this is basically useless

  • @rohanaggarwal8718
    @rohanaggarwal8718 Год назад +1

    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!!

  • @clickkode
    @clickkode 3 года назад

    Hi, thanks for the video. How do I set up PyCharm the way you have sr?

    • @deanemarks8611
      @deanemarks8611 3 года назад +1

      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!