TF StksRes

From New IAC Wiki
Jump to navigation Jump to search

FoxPro

MT4 login: 5149150

Demo Service : FxPro.com-Demo3 User:Foretony


Perl query

Make sure perl has the Finance::Quote module by using the following commands

shell> perl -MCPAN -e shell
cpan> install Finance::Quote

Finance::Quote depends on three other packages: LWP::UserAgent, HTTP::Request::Common, and HTML::TableExtractor. If yours is a relatively recent Perl installation, you'll probably already have the first two; you can download the third

sample perl script

#!/usr/bin/perl

# import module
use Finance::Quote;

# create object
my $q = Finance::Quote->new();

# retrieve stock quote
my %data = $q->fetch('nyse', 'XYZ');

# print price
print "The current price of XYZ on the NYSE is " . $data{'XYZ', 'price'};