Skip to main content

Posts

Showing posts with the label python

Real-Time Indian Stock Price Tracking with Python and Yahoo Finance

  Real-Time Indian Stock Price Tracking with Python and Yahoo Finance Introduction : Keeping track of real-time stock prices in the Indian market is crucial for investors and financial enthusiasts. Python, coupled with the powerful yfinance library, provides a convenient solution for fetching and analyzing stock data. In this article, we will explore a Python program that utilizes yfinance to fetch and display the latest stock prices of Indian companies. Code Explanation : The code starts by importing the “yfinance” library, which allows us to access stock data from Yahoo Finance. It then defines a list of Indian companies, each represented by a dictionary containing the company name and its stock symbol. Next, the program iterates over the list of companies. For each company, it extracts the stock symbol and name. Using the yfinance library, it fetches the stock data for the given symbol. The program retrieves the closing price for the most recent trading day and stores it in the ...