NSE Bhavcopy Downloader and Convertor

Discussion in 'Software' started by saji oommen, Mar 21, 2006.

  1. saji oommen

    saji oommen Active Member

    Aug 17, 2005
    Likes Received:
    Trophy Points:

    Here is a small utility that will download and convert NSE Equity Bhavcopy. The codes were written in Visual Basic. I use windows XP professional SP2 OS. This utility has some advantages and certain limitations which I will mention below. I am uploading the utility with its source code so that group members can can use it and use source code to make any changes.


    1. Will download NSE bhavcopy from NSE directly when the selected date is clicked. What the utility does is that when a Bhavcopy is downloaded it is immediately stored in the MS data access base as per the coding instructions.
    2. Generating the required output can be in ascending or descending form. I included the descending form because certain TA softwares will require data in that form. For example – Best Charts. In the generate option buton you can select all the scrips or the selected ones. Just click on the scrips. A search facility is also included to find scrip’s name or symbol easily. Currently you cannot generate output simultaneously in both ascending and descending forms. This problem can be solved easily since my programmer friend has already done it but in SQL Server 2000.
    The button delete old generated file was included because to ensure that any corruption to output data generated earlier will not affect the new output.
    3. The settings button is used to specify the output folder where you want data to be generated. Any number of folders in any directory can be specified. Example- E:\CSV data or D:\NSE Data etc or in any directory.
    4. The file extension is csv. So simply type csv in the file extension blank space and press the apply button below
    5. The projection data was a function I had requested for the following purpose. For example while analyzing scrip say in Amibroker you get a buy signal. But you feel the buy will be a good one only if the Moving averages cross over or say RSI has cut its MA. While analyzing the scrip the MAs or RSI may not have crossed its MA. So you would like to know at what price these cross over will happen. So in the projection data you can enter all the imaginary or projected price fields and volume to generate a possible scenario. A safety future has been included so that the existing down loaded data is not corrupted. So next day when you download the bhavcopy the projected data fields are automatically overwritten. I think the safety future will give a warning message box if you try to alter downloaded data. There is a delete facility for projected data entered. I am sorry to say now days I do not use this function much.


    1. Since the utility uses MS Access for data storage there are certain limitations. In MS Access there is a limit to the capacity to store data. Currently my data storage in MS Access of NSE data from year 2000 to current date amounts to 220 MB. I still use the utility. I have been told usually MS Access supports storage up to a maximum of 75-100 MB. Presently the utility is working bit slower and takes a little more time to generate the output may be because I generate data for all the scrips from year 2000. But if only a few scrips and dates are selected it runs very fast. I also feel it runs very fast on powerful computers. I use a laptop with Celeron chip with 256 MB memory.
    2. But recently we tried the utility with Microsoft SQL server2000 instead of MS Access and it is really fast with unlimited data storage capacity. For example the utility will generate both the ascending and descending output data simultaneously in 2 or 3 seconds and the downloading of bhavcopy will take another 1-2 seconds. So in 5 seconds you will have the data output from year 2000 to the current date in both ascending and desending forms of all the scrips in NSE. SQL server when installed will always be quietly running in the background without using additional system resources. There is a free version of SQL server 2005 named express edition which can be downloaded from Microsoft site. This server supports data storage capacity up to 4 GB.

    So I request you to try SQL server also. But there will be a problem while sharing with the group because the codes have to be written in SQL which requires the services of a programmer with good knowledge of SQL and database applications. And also the group members will have to use SQL server. Well it is only a suggestion. I suppose we will have to stick with MS Access. May be try to find out a way to increase MS Access storge capacity and to make it work faster. If you need data for 3-5 years this utility will more than suffice.

    3. Another disadvantage of the utility is while it was being created we had included under the equity table in the MS Acess data base the list of scrips and its other fields including the NSE ID code number unique to a scrip. Go to the installation folder double click on MS Data access file named stock quotes. There you will find a table named equity. Double click on it and you will find price and other field details of scrips.
    4. So say while output data of ACC is being generated the programme will cross check ACC symbol with its NSE ID code number in the symbol macro column of equity table to ensure that no wrong symbol data is generated. Although this is a good security check it has certain drawbacks.
    5. When new scrip is being traded at NSC its ouput will not be generated until the details of the scrip is included in the MS Access equity table. The search facility also will not list the new scrip. By altering the code little bit the programme can be instructed to generate output on symbol basis. So it will generate all scrips in the bhavcopy downloaded. This can be easily done by any VB programmer. Or anybody can cut and paste the details of new scrip from bhavcopy or the list of scrips traded being provided by NSE to the MS Access equity table. Do not forget to save the changes. And also do not leave any blank lines in between data.
    6. The utility has no merge facility. For example Tisco has changed name to Tatasteel. The utility will generate both Tisco and Tatasteel. This is OK if you are using Amibroker or any other TA software which has a merge facility. I feel this function ought to be included in the Data convertor itself since many of the Free TA programmes do not have merge facility. And this is certainly possible.
    7. The output file generated is a single file for each scrip consisting of data for dates selected. Say for example for ACC the output is a single file which will consist of data from year 2000 to the current date. Probably the utility will work even faster if output is generated for a single day. But then what happens if older generated data gets corrupted. Taking backups regularly may not be easy for all members. May be you can work out a solution.

    8. Never use the utility with the check mark on the button delete old files if the specified output folders are empty. So when reinstalling or using it for first time remove the tick other wise it will give runtime error message.

    Installation procedures is separately mentioned in the Exe. folder which is attached.

    Down LoadLink


    Group members may try the utility by downloading and generating data for its speed and other functions. Any suggestions or ideas are very much welcome. If we all pool together our resources we can create a great utility.


    Saji Oommen
  2. mustang

    mustang New Member

    Mar 22, 2009
    Likes Received:
    Trophy Points:
    Hi Saji

    Do you still have the utility to download and convert NSE bhavcopy ? I noticed that your post is very old. Can you share the latest version please. The download link mentioned in your post is not working now.

  3. ats.sa.satyamshah

    ats.sa.satyamshah New Member

    Mar 23, 2010
    Likes Received:
    Trophy Points:
    HI Saji,

    Can u post latest code or copy? Please post. Thanks a lot.



Share This Page