GT::Dependency - A dependency system for indicators/signals/systems.


This module is inheritated by any object which needs a Dependency mechanism. That's why it's listed in @ISA of GT::Indicators, GT::Signals, GT:Systems and several other modules ...

$object->add_indicator_dependency($indic, $nbdays)
$object->add_signal_dependency($signal, $nbdays)
$object->add_arg_dependency($argnum, $nbdays)
$object->add_volatile_indicator_dependency($indic, $nbdays)
$object->add_volatile_signal_dependency($signal, $nbdays)
$object->add_volatile_arg_dependency($argnum, $nbdays)

Add a dependency on a precise indicator or signal. The current object needs nbdays of history (current day included) on the given indicator or signal to be able to produce a result. A prices dependency indicates the number of days of history prices

A volatile dependency will be removed by $object->remove_volatile_dependencies(). It is used for adding last-minute dependencies whose values are known late because they are computed based on other data.


Return the dependency or list of dependencies.


Returns the number of days required so that the object can produce a result.

($first, $last) = $object->update_interval($calc, $first, $last)

Check the limits of the interval. Return new limits. The interval is contained in the first interval but all days will produce a result. The new interval may be equal to the given interval.

$object->check_dependencies($calc, $i)
$object->check_dependencies_interval($calc, $first, $last)

Check that there is enough data available. If there isn't return false. Otherwise make sure the required data are computed and return true.

$object->dependencies_are_available($calc, $i)
$object->dependencies_are_available_interval($calc, $first, $last)

Check if all dependencies have been computed.

$object->compute_dependencies($calc, $i)
$object->compute_dependencies_interval($calc, $first, $last)

Calculate all dependent indicators and detect all dependent signals.