Donnerstag, 26. Januar 2012

Testing Institutional Brokers Estimate System (ibes)

this code

#!/usr/bin/perl -w
use strict;
use warnings;
use diagnostics;
use Data::Dumper;
use Finance::Quant;
use Test;
BEGIN { plan tests => 42 }



my $home = new Finance::Quant("GOOG C AAPL");
$home->Home($home->{config});

print Dumper [
$home];

1;

__DATA__

return

1..42
# Running under perl version 5.012004 for linux
# Current time local: Thu Jan 26 23:21:11 2012
# Current time GMT: Thu Jan 26 22:21:11 2012
# Using Test.pm version 1.25_02
$VAR1 = [
bless( {
'today' => {
'/tmp' => {
'2012-Jan-26-Thu' => [
'download',
'ibes-strong-buy',
'ratings',
'symbols',
'charts'
]
}
},
'date' => 'Thu Jan 26 22:21:11 2012',
'/tmp' => {
'2012-Jan-26-Thu' => {
'charts' => {
'AAPL' => '/tmp/Finance-Quant/2012-Jan-26-Thu/charts/AAPL.png',
'GOOG' => '/tmp/Finance-Quant/2012-Jan-26-Thu/charts/GOOG.png'
}
}
},
'config' => {
'sources' => {
'RT_QUOTE' => 'http://www.nasdaq.com/symbol/%s/real-time',
'IBES_ANALYST' => 'http://www.nasdaq.com/symbol/%s/analyst-research',
'IBES_RECOMMENDATIONS' => 'http://www.nasdaq.com/symbol/%s/recommendations',
'NASDAQ_SYMBOLS' => 'http://chart.finance.yahoo.com/z?s=%s&t=3m&q=c&l=on&z=l&p=b,p,v,m20&a=m26-12-9&lang=en-US®ion=US',
'TIME_SALES' => 'http://www.nasdaq.com/symbol/%s/time-sales',
'NASDAQ_COMMUNITY' => 'http://community.nasdaq.com/community-ratings.aspx?stockticker=%s&AllRatings=1',
'IBES_ICON' => 'http://content.nasdaq.com/ibes/%s_Smallcon.jpg'
},
'nasdaq-guru-rating' => 1,
'ibes' => {
'CUSTOM' => 'GOOG C AAPL'
}
},
'textbuffer' => bless( {
'_modified' => 0,
'_currline' => 0,
'_newline' => '
',
'_autonewline' => 'unix',
'_buffer' => [],
'_debug' => 0
}, 'Text::Buffer' ),
'optical' => bless( {
'result' => {
'AAPL' => 'strong buy',
'GOOG' => 'strong buy'
},
'dir' => '.'
}, 'Finance::Optical::StrongBuy' ),
'result' => {
'symbols' => [
'AAPL',
'GOOG'
],
'AAPL' => {
'nasdaq-guru' => [
{
'pct' => '74%',
'author' => ' Peter Lynch',
'methode' => 'P/E Growth '
},
{
'pct' => '43%',
'author' => ' Benjamin Graham',
'methode' => 'Value '
},
{
'pct' => '71%',
'author' => ' Validea',
'methode' => 'Momentum Strategy '
},
{
'pct' => '72%',
'author' => ' Motley Fool',
'methode' => 'Small Cap Growth '
},
{
'pct' => '50%',
'author' => ' David Dreman',
'methode' => 'Contrarian '
},
{
'pct' => '40%',
'author' => ' Kenneth Fisher',
'methode' => 'Price/Sales '
}
],
'nasdaq-userrating' => '87% of 646 '
},
'GOOG' => {
'nasdaq-guru' => [
{
'pct' => '72%',
'author' => ' Peter Lynch',
'methode' => 'P/E Growth '
},
{
'pct' => '57%',
'author' => ' Benjamin Graham',
'methode' => 'Value '
},
{
'pct' => '57%',
'author' => ' Validea',
'methode' => 'Momentum Strategy '
},
{
'pct' => '25%',
'author' => ' Motley Fool',
'methode' => 'Small Cap Growth '
},
{
'pct' => '50%',
'author' => ' David Dreman',
'methode' => 'Contrarian '
},
{
'pct' => '40%',
'author' => ' Kenneth Fisher',
'methode' => 'Price/Sales '
}
],
'nasdaq-userrating' => '87% of 552 '
}
}
}, 'Finance::Quant' )
];

Done.