The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

DB::Text access module

Overview

This database access module enable you to work with a full directory of text files.

Configuration

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.

DB::module Text

Informs gt you are using the Text.pm module. This configuration item is always required in your $HOME/.gt/options file.

DB::text::directory path

where files are stored. This configuration item is always required in your $HOME/.gt/options file.

DB::text::marker string

Delimits fields in each row of the data file. The marker defaults to the tab character '\t'.

DB::text::header_lines number

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.

DB::text::file_extension string

To be appended to the code file name when searching the data file. For instance, if the data file is called EURUSD.csv this variable would have the value '.csv' (without the quotes).

The default file_extension is '.txt'.

if you have data in different timeframes, for instance, EURUSD_hour.csv and EURUSD_day.csv, use the following value for this directive:

DB::text::file_extension _$timeframe.csv
DB::text::format 0|1|2|3 (default is 3) The format of the date/time string. Valid values are: 0 - yyyy-mm-dd hh:nn:ss (the time string is optional) 1 - US Format (month before day, any format understood by Date::Calc) 2 - European Format (day before month, any format understood by Date::Calc) 3 - Any format understood by Date::Manip
DB::text::fields::datetime number

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.

DB::text::fields::open number

Column index where to find the period open field. Indexes are 0 based. The default open index is 0.

DB::text::fields::low number

Column index where to find the period low field. Indexes are 0 based. The default low index is 2.

DB::text::fields::high number

Column index where to find the period high field. Indexes are 0 based. The default high index is 1.

DB::text::fields::close number

Column index where to find the period close field. Indexes are 0 based. The default close index is 3.

DB::text::fields::volume number

Column index where to find the period volume field. Indexes are 0 based. The default volume index is 4.

new()

Create a new DB object used to retrieve quotes from a directory full of text files containing prices.

$db->disconnect

Disconnects from the database.

$db->set_directory("/new/directory")

Indicate the directory containing all the text files.

$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.

1 POD Error

The following errors were encountered while parsing the POD:

Around line 109:

You forgot a '=back' before '=head2'