Skip to content
Benny Thadikaran edited this page Jul 26, 2023 · 16 revisions

An automated python script to download and update NSE stocks, indices, and delivery data.

Stock Data is stored as CSV files and adjusted for splits and bonus.

  • Readily usable with tools like Pandas, Backtrader etc.
  • Usable in Market analysis and technical analysis.

Update

  • 22nd Jul 2023: Major changes to folder structure, centralized configuration, code improvements.
    • All EOD2 python code is now moved into src folder providing separation of core python code from other files. Also useful for those using python venv within the project root.
    • All EOD2 configuration is now centralized into defs/Config.py. To override the config, create a user.json in defs folder. See wiki on configuration
  • 10th Jul 2023: Added an optional feature to format bhavcopy in Amibroker format.
    • To enable this feature, edit Config.py and set AMIBROKER = True. See wiki on configuration.
    • On first run, the eod2_data/amibroker folder will be created and 365 days of bhavcopy data is downloaded and formatted.
    • Executing py defs.py will now print the script version and configuration info.
  • 23rd May 2023: Major rework on the code and new added features
    • New Rollback feature: Any errors during the data sync process can result in partially updated files and can be mess to resolve. With the updated code, any changes to the files can be rolled back to the last updated date without any manual intervention. See Installation for details
    • All the data files are now placed in a submodule, separated from the actual code. (see eod2_data). Commit logs will now be much cleaner.
    • File downloads are much faster.
  • 13th Jan 2022: EOD2 now uses pathlib module for handling file paths. This resolves file path errors on Windows platform.

Features

  • Daily EOD data for over 2000 NSE stocks since 1995.
  • Stores OHLCV and delivery data of individual stocks and indices in csv files.
  • Automatically syncs data up to the current date while keeping track of NSE holidays.
  • Makes historical adjustments for splits and bonuses.
  • Keeps track of stock ISIN for changes in company/symbol code and applies changes.
  • Prints colored alerts when NIFTY PE is below 20 and above 25.
  • Plot OHLC data with marked support and resistance levels and colored bars for high delivery days.
  • Works in both Linux and Windows.

Notes

  • CSV files for OHLC and delivery data can be found in src/eod2_data/daily and src/eod2_data/delivery.
  • All available indices are listed in 'sector_watchlist.csv'. Additional indices can be added by editing this file.
  • Stock data before 2005 may not be fully adjusted as NSE does not provide adjustment data before this year.