Finance::GeniusTrader::DB::genericdbi - Access to any database of quotes, as long as a dbi driver is available
This module is used to retrieve quotes from your existing database
You can put some configuration items in ~/.gt/options to indicate where the database is.
Make sure to retrieve the data in the following order: open, high, low, close, volume, date/time
Also, make sure to retrieve the data ordered by date/time descending Example:
SELECT period_open, period_high, period_low, period_close, volume, Concat(date, ' ', time) FROM stockprices WHERE symbol = '$code' AND timeframe='$timeframe' ORDER BY Concat(date, ' ', time) DESC LIMIT $limit
Example:
SELECT name FROM stockinfo WHERE symbol = '$code';
Finance::GeniusTrader::DB::genericdbi->new()
$db->disconnect
Disconnects from the database.
$db->get_prices($code, $timeframe)
Returns a Finance::GeniusTrader::Prices object containing all known prices for the symbol $code.
$db->get_last_prices($code, $limit, $timeframe)
Returns a Finance::GeniusTrader::Prices object containing the $limit last known prices for the symbol $code in the given $timeframe.
$db->get_db_name($code)
Returns the name of the stock designated by $code.
To install Finance::GeniusTrader, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Finance::GeniusTrader
CPAN shell
perl -MCPAN -e shell install Finance::GeniusTrader
For more information on module installation, please visit the detailed CPAN module installation guide.