[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

EOD stock data made EZ



PureBytes Links

Trading Reference Links

This might be of interest to anyone looking for EOD stock data on a large
number of symbols and struggling with HyperTrader's yahoo downloader or
something else. HT's downloader is _slow_. period. A far more effective way
is to get a data file and put that in GS. eoddata.com let's you do the
getting data part, and I have a perl script that let's you do the rest.

if you signup with eoddata.com (free), you can download the day's and some
of the previous day's data in a nice little file for most every exchanges.
Download them.. time spent 1-2 minutes. Then run the following perl script,
which would take the data files, clean it up, call HyperTools and produce
the .xpo (< 5 min). All this for 7000+ symbols. Just import the .xpo in GS
and you are all set to run your analysis.

I am sharing this in the hope it would be useful to some folks in the list.
I am willing to answer questions about the script, but can't help anyone
setting up or running perl etc. Hope you understand. If you find this to be
very useful for you but need some handholding with the technical parts, I
can work with you if you are willing to compensate me for the time spent.

You can download perl from http://www.activestate.com/Products/ASPN_Perl/.
Just download and install it. Then open a command prompt in a directory, say
C:\eoddata. Save the script in that directory, say makexpo.pl. Before you
run the script, download the files from eoddata.com to the same directory.
Then run the script like this

perl makexpo.pl -d 20040511

"eodstockD" referenced at the end of the script is a HyperTools conversion
set that you have to setup. It's just a one time setup.

Thanks,

Abhijit


###########################################################
# Download eod stock data from eoddata.com for AMEX, NASDAQ & NYSE
# Process stock data and prepare to import it to GS
#
# input : -d yyyymmdd
###########################################################

use Getopt::Long;

# defaults
$inputdir = '.';
$outputdir = '.';
$thisdate = 0;

# external programs
$htoolsexe = "\"C:\\Program
Files\\HyperTools\\2.0\\XPO\\hstools.exe\" -close ";

# get commandline options
GetOptions('d=i' => \$thisdate);
die "*** - FATAL - Please input date" unless $thisdate != 0;

opendir(DIRIN, '.') or die "*** - FATAL - Cant open $!";
my @infiles = grep !/^\.\.?/ && /AMEX|NASDAQ|NYSE/ && /$thisdate/ && /txt$/,
readdir DIRIN;

$outfile = "tmpoutcombined.txt";
if (-e $outfile)
{
    unlink($outfile) or die "*** - FATAL - Can't delete $outfile!";
}

$outfilexpo = "xpooutcombined.xpo";
if (-e $outfilexpo)
{
    unlink($outfilexpo) or die "*** - FATAL - Can't delete $outfilexpo!";
}

open(ProcessedFileHandle, ">>$outfile");

foreach $infile (@infiles) {
    open(QuoteFileHandle, $infile);
    print "Processing $infile\n";
    @lines = <QuoteFileHandle>;       # read all lines into an array
    close(QuoteFileHandle);

    foreach $line (@lines) {
        @fields = split(/,/, $line);
        if($fields[0] !~ /[-.<]/) {
            $line =~ s/,D//;
            print ProcessedFileHandle $line;
        }
    }
}

close(ProcessedFileHandle);

# make xpo
print "Making xpo file... please wait... ";
system($htoolsexe."\"eodstockD\"");
print "done\n";






  • References: