Skip to content
← Back to Community
automatic input of quotes from the internet
Profile icon
rogeryoung

Is there any way I can program the computer to get stock quotes from the internet and input them into my program automatically so I do not have to do this manually ?
I am wondering if one would have to subscribe to some sort of expensive streaming service to do this.

Comments
hotnewtop
Profile icon
SixBeeps

The yfinance package is completely free to use, and it's relatively easy. You just need to install the yfinance and lxml packages and use them accordingly. I made this sketch Repl that demonstrates yfinance.

Profile icon
rogeryoung

@SixBeeps Thank you so very much for this information. The price data for the stocks is uploaded into my system beautifully but the problem now is that I am unable to incorporate it into my program so that it will multiply times the number of shares automatically. I would be very very thankful if you could give me some guidance as to how to do this or where I can find out how to do this.
Regards,
Roger Young

Profile icon
SixBeeps

@rogeryoung So in your program, instead of having the user input the price, you can set your variables to some functions from the library.

Here's an example of that with VTI:

stock = yf.Ticker('vti') vti = float(info['previousClose']) vtish = float(input("enter # vti sh >>>")) vtival = vti*vtish
Profile icon
rogeryoung
Profile icon
rogeryoung

@rogeryoung Many many thanks for your help with my program. I love the way this is evolving and you have been wonderful.

Profile icon
SixBeeps

@rogeryoung You are very welcome :)

Please mark my comment as the answer if I've helped