DB::HTTP - Retrieve prices from a CGI
This access module enable you to download prices from a remote server using a CGI script (cf web/quotes.pl).
Most configuration items have default values, to alter these defaults you must indicate the configuration item and its value in your $HOME/.gt/options file, especially for authentification purpose.
Informs gt you are using the HTTP.pm module. This configuration item is always required in your $HOME/.gt/options file.
Delimits fields in each row of the data file. The marker defaults to the tab character '\t'.
The number of header lines in your data file that are to be skipped during processing. Lines with the either the comment symbol '#' or the less than symbol '<' as the first character do not need to be included in this value.. The header_lines default value is 0.
Column index where to find the period datetime field. Indexes are 0 based. For the particular case of datetime, can contain multiple indexes, useful when date and time are separate columns in the data file. The date time format is anything that can be understood by Date::Manip. A typical example would be YYYY-MM-DD HH:NN:SS. The default datetime index is 5.
Column index where to find the period open field. Indexes are 0 based. The default open index is 0.
Column index where to find the period low field. Indexes are 0 based. The default low index is 2.
Column index where to find the period high field. Indexes are 0 based. The default high index is 1.
Column index where to find the period close field. Indexes are 0 based. The default close index is 3.
Column index where to find the period volume field. Indexes are 0 based. The default volume index is 4.
You can set the DB::HTTP::directory configuration item to tell where the quotes are cached.
new()
Create a new DB object used to retry quotes from a CGI on a remote server.
$db->disconnect
Disconnects from the database.
$db->set_directory("/new/directory")
Indicate the directory containing all the cached data.
$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)
NOT SUPPORTED for HTTP db.
Returns a Finance::GeniusTrader::Prices object containing the $limit last known prices for the symbol $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.