Jul 24, 2011

BSE Bhavcopy with Delivery Quantity

One of my TI forum members IV had a requirement for BSE Quotes along with Delivery Quantity. This made me implement "merge" function of R (thanks to the great work done by people behind various packages and guidance available on R Mailing lists).

The task involves downloading files from two separate links and merging it on the basis of Symbol on any given date.


The output is a single file for one trading day. With a slight tweak in the code, single file can be generated for a week, a month, a year , or from beginning to end. If anyone is interested, let me know, and will offer the solution for the same

Without much write-up here is the code for the same.

For those, who want to take a shortcut, here are historical quotes

Jul 19, 2011

Extracting EOD Data from BSE

Earlier, I had worked around to download Bhavcopy from NSE. Now, I would make a similar attempt to download the BSE Bhavcopy

Objective: Download Bhavcopy (Equity) from http://www.bseindia.com and save only relevant columns Date, Symbol, Name, Open, High, Low, Close, Last and Volume.

[Fixed] Extracting EOD Data from NSE

My prime interest being the Indian financial markets, the first step would be to get the data to play around. NSE India provides EOD of data as bhavcopies. The same are stored as zipped files at their servers. Downloading them one by one for a larger time frame will be very tedious, hence I will attempt to automate the process.

There is a great tool for statistical computing called R. It is open-source with a lot of development being done across various packages. This interests me a lot because of it simplicity and power. I would make my attempt of automating bhavcopy downloads using this software. If you want to try the same, you can visit the downloads section of R-Project and get the latest version


Objective: Download Bhavcopy (Equity) from http://www.nseindia.com and save only relevant columns Date, Symbol, Open, High, Low, Close, Last and Volume.

To download the Bhavcopy (Equity) from http://www.bseindia.com refer to this post.