Author image Kevin Ryde
and 1 contributors


GT::DB::Chart - GeniusTrader access to data from Chart


 use GT::DB::Chart;
 my $db = GT::DB::Chart->new;
 my $prices = $db->get_prices ('BHP.AX', $GT::Prices::DAYS);


This is a GT::DB module giving access to the Chart database from GeniusTrader scripts and calculations.


$db = GT::DB::Chart->new()

Create and return a new GT::DB::Chart object to retrieve data from the Chart database (~/Chart/database.sqdb).


Disconnect from the Chart database.

$prices = $db->get_prices ($symbol, $timeframe)
$prices = $db->get_last_prices ($symbol, $limit, $timeframe)

Create and return a GT::Prices object with the data for $symbol in the given $timeframe increments. $timeframe can be $DAYS, $WEEKS, $MONTHS or $YEARS.

get_prices() returns all available data for $symbol, get_last_prices() returns only the most recent $limit many values (or as many as available). For example to get the last 250 trading days,

    my $prices = $db->get_last_prices ('GM', 250,
$str = $db->get_db_name ($symbol)

Return the company name for the stock $symbol, or undef if unknown.

For most applications use $db->get_name() instead (see GT::DB), since it tries your ~/.gt/sharenames file if nothing from get_db_name().


GT::DB, GT::Prices




Copyright 2008, 2009, 2010, 2011, 2012, 2014, 2015, 2016, 2017, 2018, 2019, 2020 Kevin Ryde

Chart is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version.

Chart is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with Chart; see the file COPYING. Failing that, see