Finance


Yahoo Stock Screening Using Perl

So you need to screen stocks? And you want to automate the process?
Well I have not found much out there in the “Free” world that lets you do this. Yahoo seems to be about the best screening tool especially for Trend Traders as it allows you to filter on BETA. The only thing I don’t […]

Yahoo Finance Economic Events to XML with Perl

This is a very simple script which gets yahoo economic events from the yahoo finance website and converts it to XML.

#!c:\perl\bin\perl.exe
use LWP::Simple;
use LWP::UserAgent;
use HTML::TableExtract;
use CGI;
use CGI::Carp qw(fatalsToBrowser);
my $cgi = new CGI;
my $url = “http://biz.yahoo.com/c/e.html”;
my $capture = get($url);
#http://www.treasurydirect.gov/xml/PendingAuctions.xml
print $cgi->header(-type => ‘application/xml’); # make browser expect xml
$te = HTML::TableExtract->new( depth => 0, count => 5 );
print […]

Yahoo Finance Get Industry and Sector using Perl

This script parses yahoo finance an pulls the Industry and sector for any ticker symbol you pass it. I used it to create a stock screener I am working on. Hope it becomes useful for you.

#!c:\perl\bin\perl.exe
use LWP::Simple;
use LWP::UserAgent;
use HTML::TableExtract;
if ($#ARGV != 0) {
print “$#ARGV usage: need to pass in a symbol\n”;
exit;
}
$sym = $ARGV[0];
my $url = […]

Dividend Reinvestment Calculator

I have been a moderate investor in Dividend Reinvestment Plans. aka (DRIPS) If you are not sure what that is, check out http://www.fool.com/school/drips.htm as they do a pretty good job explaining it.
But basically it allows investors to buy shares of a particular equity on a periodic basis (bi-weekly, monthly,quarterly etc). Dividends on that […]