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

Re: [GT] Beginner questions...



Michael S wrote:
Thanks Robert. I couldn't get that to work. It just seems to echo the argument. I will have another look at it later today when I have more time. Thanks again :)


humm -- that means there isn't a company name in the metastock database
or that the subroutine get_db_name in the metastockreader package isn't
working.

the print "$ARGV[0]\n"; statement should have been more explicit:
print "no company name found. the symbol read was $ARGV[0]\n";

i'd start adding print statements there (the metastockreader package) and
work outwards if there's actually a name in the metastock database.

ras



Date: Sun, 15 Jun 2008 12:53:26 -0700
From: ras
AT
acm.org
To: nut129
AT
hotmail.com
CC: devel
AT
geniustrader.org
Subject: Re: [GT] Beginner questions...

Michael S wrote:

Hi,

I am a very new starter with GeniusTrader but so far seems great :) Just managed to get it set up on my Windows system with only a few minor issues.

I use the MetaStockReader to read my data and I'm trying to work out how I can possibly get two things.... one, the number of stocks in the MetaStock data directory (preferably the stock symbols in an array or something).... and two, the names of the stocks (eg. Google Inc. for GOOG).

I know these are probably very basic questions, but I can't work out the answer or find any clues anywhere so I would certainly love the help.

Thanks :)
_________________________________________________________________
Now you can invite friends from Facebook and other groups to join you on Windows Live™ Messenger. Add now.
https://www.invite2messenger.net/im/?source=TXT_EML_WLH_AddNow_Now


aloha michael

the metastock database format is custom if not proprietary. you can read through the
perl code for the MetaStockReader module to see if there are any clues there that
might allow you to derive the data you seek. if there is a metastock users/developers
list you might post your query there.

can i inquire why you want this data? well, i can understand wanting the company name
but why do you need the number of symbols being tracked? aren't these data available
using metastock itself?

well, looking at GT::DB::MetaStockReader, the subroutine get_db_name should actually
return the name associated with the symbol. does that not work?

this works here, for beancounter db
#!/usr/local/bin/perl -w -I..
#!/usr/bin/perl -w -I..

use GT::Conf;
use GT::Eval;

GT::Conf::load();

if ( $#ARGV != 0 ) {
 die "provide symbol on command line\n";
}

my $db = create_standard_object("DB::" . GT::Conf::get("DB::module"));

my $longname = $db->get_name(uc($ARGV[0]));

if ($longname) {
   print "$longname - $ARGV[0]\n";
} else {
   print "$ARGV[0]\n";
}

ras [ 835 ] %    print_company_name.pl goog
GOOGLE - goog

you might need to switch first two lines, depending on your perl location.
it relies on a properly setup $HOME/.gt/options file to locate your securities
database module.


each of these infos can be had easily if you use beancounter with a database engine it
integrates, don't know if it works with the windblown os though. beancounter collects
end-of-day data using yahoo.

ras



_________________________________________________________________
It’s easy to add contacts from Facebook and other social sites through Windows Live™ Messenger. Learn how.
https://www.invite2messenger.net/im/?source=TXT_EML_WLH_LearnHow