EOD Download/ Convert from NSE and BSE

pkjha30

Well-Known Member
#81
Debraj said:
Hi Pankaj,

For some reason NSE data of 2006_03_6 got downloaded and converted today. When I tried Satya's DataExtractor, the download and conversion were OK.

There are a couple of minor issues. I shall post them, if necessary, after trying out the next version.

Warm regards,

Debraj
Hi Debraj
Just saw your message. I downloaded today's file and it was ok with the old program.May be Some date setting /format problem.

I am on to new version. Before release I will try to check if I could replicate your problem. Before downloading any file do check the listed urls in the queue If not in proper format do tell me.It can be removed and then you can try again putting the url in queue.

As I am working on the exchange of bhav copies <per> and <o/i> is not included since I have written a routine for one to one translation of header. Will it cause any problem.

Editing of settings related files will be now done within the programme itself. Holiday will be in the format suggested by murthy. That part is over.

Thanks
Pankaj
 
#82
Hi Pankaj,

After clicking Add URL the file name in the Download status window is cm6MAR2006BHAV.csv. The File URL Path Download Queue is http://www.nseindia.com/content/historical/EQUITIES/2006/MAR/cm6MAR2006BHAV.csv. Date is 03/06/2006.

You are right in tracing the cause of today's download trouble to "date setting /format problem". I think the problem is being caused by the date format in the download screen. It is in Indian, ie, DDMMYYYY format. According to it, today is 4 Apr 2006(03/04/2006). But the dropdown calendar is in MMDDYYYY format. So the software is interpreting 03/04/2006 as 4 Mar 2006. This being a Saturday, the software is downloading next available day's data - that of Monday 6 Mar.

Whether your routine for "one to one translation of header" would cause any problem would become clear only after trying out the new version.

Warm regards,

Debraj
 

rpc

Active Member
#83
Hi Mr Jha
I have downloaded your EOD Downloader.It is quite commendable
that you are making available for FREE such a nice software.
I used it to convert *.csv files from NSE but I found the
converted *.txt file had blank line as first line.I have deleted
following two lines from application.ini

sHeaderRecordNseD=<name>,<date>,<open>,<high>,<low>,<close>,<volume>
sHeaderRecordNseU=<name>,<date>,<open>,<high>,<low>,<close>,<volume>

Checking or unchecking of "No Header Line" makes no difference
Pls advice how can I make the blank line go.

Secondly I would like to suggest when files are converted the source
files are removed and copied to Oldfiles directory.Can you
provide an option so that such files are not removed.

Thirdly is it possible to include downloading of sensex and nifty ?

rpc
 

pkjha30

Well-Known Member
#84
rpc said:
Hi Mr Jha
I have downloaded your EOD Downloader.It is quite commendable
that you are making available for FREE such a nice software.
I used it to convert *.csv files from NSE but I found the
converted *.txt file had blank line as first line.I have deleted
following two lines from application.ini

sHeaderRecordNseD=<name>,<date>,<open>,<high>,<low>,<close>,<volume>
sHeaderRecordNseU=<name>,<date>,<open>,<high>,<low>,<close>,<volume>

Checking or unchecking of "No Header Line" makes no difference
Pls advice how can I make the blank line go.

Secondly I would like to suggest when files are converted the source
files are removed and copied to Oldfiles directory.Can you
provide an option so that such files are not removed.

Thirdly is it possible to include downloading of sensex and nifty ?

rpc
Hi rpc

in next versionfirst problem is sorted out. But not yet uploaded as testing is going on on two systems.

Normally when you update a file it wil take all the files visible in the input box and convert.So I thought once the major download is complete daily updation can be done and files which are moved out of equities folder will not again get conveted while saving the original files for future use in this or some other software. With your idea I have to keep track of the files converted,possible, but might lead to unexpected problem.Removing duplicates will be one such issue. Sorting converted file will be another. Text files are easy to read with other available softwares but difficult to sort and find duplicates. It consumes a lot of resources which would make it slower. In any case this problem will come ,once the file becomes too large. I am onto that.

I will certainly give your idea a thought.Perhaps an option to put files in your favourite folder instead of default would be on way to work. What do you think?

Yes it is possible to download nifty and sensex.I didnot give it much effort though worked on that. One such request is listed in my task list. I will see if I can include that before next release.

Regards
Pankaj
 
Last edited:

murthymsr

Well-Known Member
#85
Hi pankaj,

quote:
......... Yes it is possible to download nifty and sensex.I didnot give it much effort though worked on that. One such request is their listed in my task list. I will see if I can include that before next release. .........
:unquote

it's a very good idea. You may think of including the various other indices like junior nifty, midcap, and the sectorial indices of BSE/NSE depending on the availability at the source chosen by you.

Thanks for your time.
murthymsr
 

rpc

Active Member
#86
Hi Mr Jha
Thanks for the reply.Pls don't bother to provide option for not removing files if it involves a lot of work.We are quite content with what you have provided.You have provided a great software.
Keep it up !
rpc
 

murthymsr

Well-Known Member
#87
hi pankaj,

sorry for using your thread for some clarification on data format.

i refer to the bhav copy of NSE and not PR.ZIP file.
the format of timestamp column is slightly confusing.

as i understand, the column represents

1) the datepart is with the leading zeros suppressed.

2) in the year part, sometimes the century is shown and some other times not shown. ( i couldn't understand the logic though)

3) to ascertain the data format, i viewed the file in windows notepad, wordpad, excel and other non-windows notepads.

i request, pankaj, satya, joy_mitali and others to record their observations on the data format. this will help be to overcome some of the problems presently faced with my stock screener software.

thanks in advance.

murthymsr
 
Last edited:

pkjha30

Well-Known Member
#88
murthymsr said:
hi pankaj,

sorry for using your thread for some clarification on data format.

i refer to the bhav copy of NSE and not PR.ZIP file.
the format of timestamp column is slightly confusing.

as i understand, the column represents

1) the datepart is with the leading zeros suppressed.

2) in the year part, sometimes the century is shown and some other times not shown. ( i couldn't understand the logic though)

3) to ascertain the data format, i viewed the file in windows notepad, wordpad, excel and other non-windows notepads.

i request, pankaj, satya, joy_mitali and others to record their observations on the data format. this will help be to overcome some of the problems presently faced with my stock screener software.

thanks in advance.

murthymsr
Hi Murthy d
Date is always a problem for those who venture to make programme especially in vb6
There are different ways to represent dates > Two major format are european system(dd/mm/yyyy), american system(mm/dd/yyyy).
So if you tell 911 in america it would mean 11 sept but in europe it would mean 9 Nov.

Due to this lack of uniformity processing is a porblem.

So let us see this problem from a different perspective.
Internal processing in vb6 is done in mmddyyyy format
External display is in system locale or user defined format

When you accept the date it will be correctly interpreted if variable is defined as date. For external representation use of Format commad is required.

If external representation is assigned to string then in conversion process vb will incorrectly interprete the date .
Now nse data is given in dd-mmm-yyyy format. In notepad and word you will see it displayed as given since it will be in text format(string data) In excel it will be represented in your system locale format or user defined format as the variable is date type.

If your system format is ddmmyy leading zero in year will be suppressed. if it is dmyy the leading zeros in date month and year will be suppressed.

options is to check the format of your system or user defined format and then take the string and appropriately format and assign it to date variable which will then correctly interpret it.
API calls for this purpose are

Option Explicit

Public Const DATE_LONGDATE As Long = &H2
Public Const DATE_SHORTDATE As Long = &H1
Public Const LOCALE_SLANGUAGE As Long = &H2 'localized name of language
Public Const LOCALE_SSHORTDATE As Long = &H1F 'short date format string
Public Const LOCALE_SLONGDATE As Long = &H20 'long date format string

Public Declare Function GetThreadLocale Lib "kernel32" () As Long

Public Declare Function GetSystemDefaultLCID Lib "kernel32" () As Long
Public Declare Function GetUserDefaultLCID Lib "kernel32" () As Long


Public Declare Function GetLocaleInfo Lib "kernel32" _
Alias "GetLocaleInfoA" _
(ByVal Locale As Long, _
ByVal LCType As Long, _
ByVal lpLCData As String, _
ByVal cchData As Long) As Long

Public Declare Function EnumDateFormats Lib "kernel32" _
Alias "EnumDateFormatsA" _
(ByVal lpDateFmtEnumProc As Long, _
ByVal Locale As Long, _
ByVal dwFlags As Long) As Long

Hope this will help you
Pankaj
 

pkjha30

Well-Known Member
#89
Hi Debraj and saritguha
I could not pm you as it does not seems to be enabled. If you give email I will send next version before I upload it to the briefcase for others
Pankaj
 

Similar threads