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

NAME

Finance::GeniusTrader::Indicators - Provides some functions that will be used by all indicators.

DESCRIPTION

GENERIC EXPORTED FUNCTIONS

build_object_name($encoded, [ @args ], $key)

Generate the name of an indicator based on its "encoded" name.

FUNCTIONS TO RETRIEVE USUAL PRICES

$GET_OPEN, $GET_FIRST, $GET_HIGH, $GET_LOW, $GET_LAST, $GET_CLOSE and $GET_VOLUME are functions references that can be passed as arguments to some indicators where input functions are expected. They are automatically exported when doing "use Finance::GeniusTrader::Indicators;".

For example, the indicator AMA (Arithmetic Moving Average) can be used to calculate the average of anything (other indicators or prices). You can provide those functions if you want to calculate an average of some prices (or quotations or volumes).

MANAGE A REPOSITORY OF INDICATORS

  Finance::GeniusTrader::Indicators::get_registered_object($name);
  Finance::GeniusTrader::Indicators::register_object($name, $object);
  Finance::GeniusTrader::Indicators::get_or_register_object($name, $object);
  Finance::GeniusTrader::Indicators::manage_object(\@NAMES, $object, $class, $args, $key);

DEFAULT FUNCTIONS FOR INDICATORS

Finance::GeniusTrader::Indicators::Module->new($args, $key, $func)

Create a new indicator with the given arguments. $key and $func are optional, they are useful for indicators which can use non-usual input streams.

$indic->calculate_all($calc)

calculate_all will calculate all the values of the indicators for all possibles days.

$indic->calculate_interval($calc, $first, $last)

Provide a default non-optimized version of calculate_interval that calls calculate once for each day.

Real indicators are encouraged to override this function to provide an optimized version of the calculation algorithm by possibly reusing the result of previous days.

$indic->initialize()

Default method that does nothing.

$indic->get_name
$indic->get_name($n)

Get the name of the indicator. If the indicator returns several values, you can get the name corresponding to any value, you just have to precise in the parameters the index of the value that you're interested in.

$indic->get_nb_values

Return the number of different values produced by this indicator that are available for use.