GT::Signals - Base module for all signals



Signals are objects that returns true/false for each quotation. This value doesn't have any other direct meaning (ie it's not buy/sell). However those results will probably be used by trading systems (in cunjunction with other informations) to decide what to do (buy/sell/update a stop/nothing).

Detailed description

my $sig = GT::Signals::AnExample->new([ @args ])

Create a signal object with the appropriate parameters.

$sig->get_name or $sig->get_name($i)

Get the name of the signal. If the signal 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.


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


This callback function is called at creating time. Since the "new" function is inherited, you should do the initialization via this function.

$sig->detect($calc, $i)

Stores the value of the signal for the day $i.

$sig->detect_interval($calc, $first, $last)

Stores the value of the signal for all the days of the specified interval.

General exported functions

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

Generate the name of a signal based on its "encoded" name.

Functions to manage a repository of signals

  GT::Signals::register_object($name, $object);
  GT::Signals::get_or_register_object($name, $object);
  GT::Signals::manage_object(\@NAMES, $self, $class, $args, $key);