print("Download complete! Check your folder for the CSV file.")
import yfinance as yf import pandas as pd nifty = yf.download("^NSEI", start="2000-01-01", end="2024-12-31") Save to CSV nifty.to_csv("nifty_50_historical_data.csv") yahoo finance nifty 50 historical data csv
Drop a comment below, and I will help you find the cleanest data. print("Download complete
You can schedule this script to run daily, ensuring you never have to manually export data again. Understanding the CSV Columns Once you open the file, here is what you are looking at: analyzing market trends
If you are backtesting a trading strategy, analyzing market trends, or building a financial model, you need clean, reliable historical data. The Nifty 50 is India’s benchmark index, and fortunately, you can get decades of history for free via Yahoo Finance.
Ce site utilise des cookies techniques nécessaires à son bon fonctionnement. Ils ne contiennent aucune donnée personnelle et sont exemptés de consentements (Article 82 de la loi Informatique et Libertés).
Vous pouvez consulter les conditions générales d’utilisation sur le lien ci-dessous.