Tool to download months old NSE BhavCopy in one go

Discuss Tool to download months old NSE BhavCopy in one go at the Data Feeds within the Traderji.com - Discussion forum for Stocks Commodities & Forex; hi guys, I visited this site today itself and found it quite helpful for myself. ...


Go Back   Traderji.com - Discussion forum for Stocks Commodities & Forex > TOOLS & RESOURCES > Data Feeds
Register Blogs FAQ Chat Room Search Today's Posts Mark Forums Read

Data Feeds Real time and end-of-day data feeds.


Welcome to the Traderji.com - Discussion forum for Stocks Commodities & Forex.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features.

By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please read the FAQ.

Reply
 
Thread Tools
Sponsored Links
  #1  
Old 18th August 2007, 01:41 AM
Member
 
Join Date: Aug 2007
Posts: 13
flyingdeath is on a distinguished road
Default Tool to download months old NSE BhavCopy in one go



hi guys,
I visited this site today itself and found it quite helpful for myself.
I also installed MetaStock tool and wanted to gather some historic data which ofcourse is not always uptodate.
So I quickly wrote a utility to download the set of 3 month old BhavCopies from NSE-India.com. (Thankfully MS quotes till 14-Jun are already available).

Here I'm posting the simple C# Code which will download all the bhavcopies into your C:\NSE folder.
I'm posting the code so you can tweak it according to your requirments.

Code:
using System;
using System.Collections.Generic;
using System.Text;
using System.Net;
using System.Net.NetworkInformation;
using System.Diagnostics;
using System.IO;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] monthList = new string[3] { "JUN", "JUL", "AUG" };
            try
            {                
                Uri uri = new Uri(@"http://www.nse-india.com/content/historical/EQUITIES/2007/");
                Uri tempUri;
                foreach (string month in monthList)
                {
                    WebClient client = new WebClient();
                    FileStream writer;
                    for(int i = 1; i <31; i++)
                    {
                        try
                        {
                            string iStr = (i <= 9) ? "0" + i.ToString() : i.ToString();
                            tempUri = new Uri(uri, month + "/cm" + iStr + month + "2007bhav.csv");
                            Debug.WriteLine("Downloading " + tempUri.ToString());
                            byte[] data = client.DownloadData(tempUri);
                            using (writer = File.Create(@"C:\NSE\cm" + i.ToString() + month + "2007bhav.csv"))
                            {
                                try
                                {
                                    writer.Write(data, 0, data.Length);
                                }
                                finally
                                {
                                    if (writer != null)
                                        writer.Close();
                                }
                            }
                        }
                        catch (WebException ex)
                        {
                            if (ex.Status == WebExceptionStatus.ProtocolError && ex.Message.Contains("404"))
                                Debug.WriteLine("FileNotFound");
                            continue;                            
                        }
                    }

                }
            }
            catch (Exception ex)
            {
                Debug.WriteLine("Failed");
            }

        }
    }
}
Also attached is an executable file which upon doubleclicking will download the files to C:\NSE folder.
Note - You will have to create the NSE folder in C drive manually.

I'm also trying to write a CSV converter so that it will be easy to import from Downloader. If I get some time I'll post it in few hours.

For any queries you can contact me at talksandy AT airtelbroadband.in

Attached Files
File Type: zip ConsoleApplication1.zip (2.5 KB, 113 views)
Reply With Quote
  #2  
Old 18th August 2007, 05:39 PM
sak sak is offline
Member
 
Join Date: Jul 2007
Posts: 5
sak is on a distinguished road
Default Re: Tool to download months old NSE BhavCopy in one go

Hi flyingdeath,
It is asking for MSCOREE.DLL file. Where can I get it?

Reply With Quote
  #3  
Old 20th August 2007, 05:27 PM
Member
 
Join Date: Apr 2007
Posts: 21
pokrate is on a distinguished road
Default Re: Tool to download months old NSE BhavCopy in one go

Install .net 1.0 or higher and it will work fine. Nice utility which solves the major problem. Now we must write a utility to convert CSV file to metastock format.

Reply With Quote
  #4  
Old 22nd August 2007, 04:26 AM
Member
 
Join Date: Aug 2007
Posts: 13
flyingdeath is on a distinguished road
Smile Re: Tool to download months old NSE BhavCopy in one go

Quote:
Originally Posted by pokrate View Post
Install .net 1.0 or higher and it will work fine. Nice utility which solves the major problem. Now we must write a utility to convert CSV file to metastock format.
Someone has already wrote a nice tool to do all that stuff. Its a GUI tool that converts file to MetaStock format csv
Link is
http://www.traderji.com/software/596...se-bse-12.html

Anyway I like command line tool that will do that automatically for me. So if anyone knows about the Downloader's command line option it will be very helpful.

Reply With Quote
  #5  
Old 22nd August 2007, 10:17 AM
Member
 
Join Date: Apr 2007
Posts: 21
pokrate is on a distinguished road
Default Re: Tool to download months old NSE BhavCopy in one go

Hi !
Please tell me where to get NSE data to use with metastock. I am new for this software.

Reply With Quote
  #6  
Old 23rd August 2007, 02:46 AM
Member
 
Join Date: Aug 2007
Posts: 13
flyingdeath is on a distinguished road
Default Re: Tool to download months old NSE BhavCopy in one go

Quote:
Originally Posted by pokrate View Post
Hi !
Please tell me where to get NSE data to use with metastock. I am new for this software.
I uploaded data till yesterday in the following thread
http://www.traderji.com/data-feeds/1...-database.html

Reply With Quote
  #7  
Old 23rd August 2007, 09:29 AM
Member
 
Join Date: Apr 2007
Posts: 21
pokrate is on a distinguished road
Default Re: Tool to download months old NSE BhavCopy in one go

Hearty thanks !
I think, I have found the right person who can guide me in using METASTOCK.

Reply With Quote
  #8  
Old 24th August 2007, 01:10 AM
Member
 
Join Date: Aug 2007
Posts: 13
flyingdeath is on a distinguished road
Default Re: Tool to download months old NSE BhavCopy in one go

Quote:
Originally Posted by pokrate View Post
Hearty thanks !
I think, I have found the right person who can guide me in using METASTOCK.
I hope its not me.
I recently started using this myself but I'm feelin comfortable with it. AmiBroker is good too and a lil bit more user friendly.

Gotta go a long way before doing some serious stuff with it.

Reply With Quote
  #9  
Old 26th August 2007, 01:34 AM
Member
 
Join Date: Apr 2007
Posts: 21
pokrate is on a distinguished road
Default Re: Tool to download months old NSE BhavCopy in one go

Quote:
Originally Posted by flyingdeath View Post
I hope its not me.
I recently started using this myself but I'm feelin comfortable with it. AmiBroker is good too and a lil bit more user friendly.

Gotta go a long way before doing some serious stuff with it.
Hi buddy,
I have got Amibroker now. Kindly help me in managing it.
How to get historical data and how to update data ?
Eagerly awaiting your friendly reply.

Reply With Quote
  #10  
Old 4th September 2007, 05:11 PM
Member
 
Join Date: Jun 2007
Posts: 17
rajuwaste is on a distinguished road
Default Re: Tool to download months old NSE BhavCopy in one go

When I refer NSE bhavcopy there is a mix of EQ and BE series how do you people handle this.For example several entries of same date's data exist in NSE Bhavcopy what should I do to solve this problem.

Reply With Quote
Sponsored Links


Reply


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads for: Tool to download months old NSE BhavCopy in one go
Thread Thread Starter Forum Replies Last Post
Power IPOs will take six more months to light up Robbie Initial Public Offers (IPO's) 0 25th November 2006 10:30 AM
6 weeks , 6 months, 6 years . . . mohdbinhaid General Chit Chat 0 9th June 2006 07:33 PM
5 mins intraday data dor 2 months tanewbie Data Feeds 47 18th March 2006 03:19 PM



All times are GMT +5.5. The time now is 08:52 AM.

Indemnity, Disclaimer & Disclosure Notice:
• By visiting Traderji.com you indicate your acceptance of our Forum Rules Disclaimer & Disclosure and indemnify Traderji.com, its associates and related parties of all claims howsoever resulting from the usage of the forum.
Disclaimer: Trading or investing in stocks & commodities is a high risk activity. Any action you choose to take in the markets is totally your own responsibility. Traderji.com will not be liable for any, direct or indirect, consequential or incidental damages or loss arising out of the use of this information.
Disclosure: The information in this forum is neither an offer to sell nor solicitation to buy any of the securities mentioned herein. The writers may or may not be trading in the securities mentioned.
• All names or products mentioned are trademarks or registered trademarks of their respective owners.
General Content Disclaimer Notice:
In light of our policy of encouraging candid, open exchanges of views and the rapid distribution of information originating from many sources, Traderji.com cannot determine the accuracy of information that may be uploaded to the forum. Opinions, advice and all other information expressed by participants in discussions are those of the author. You rely on such information at your own risk. You are urged to seek professional advice for specific, individual situations and not rely solely on advice or opinions given in the discussions. Since Traderji.com is an open and free discussion forum, any comments made by members of this forum in their posts reflect their own views and not of the owner or administrator of Traderji.com. Thus the owner/administrator indemnify themselves of all claims whatsoever and will not be liable or responsible for any members comments/views in this forum Traderji.com. If you find any objectionable or offensive posts made by members of this forum which you would like to bring to our notice for removal then please Contact Us.
 


Copyright © 2001 - 2008, Traderji.com All Rights Reserved.

Recommended Websites - www.TradersEdgeIndia.com - www.TradingPicks.com - www.HiFiVision.com - www.MasterOfTrading.com - www.NotebookTalk.com