GT::Systems -


Trading systems are systems that decide what to buy and sell at which prices and so on.

A system will propose buy/sell orders. The day after, those orders will be either cancelled or confirmed. If the order is confirmed, then a position is considered open. An open position will then be managed by a close strategy.

$system->long_signal($calc, $i) =item $system->short_signal($calc, $i)

The system can generate 2 signals (buy or sell). A signal is an intent to buy or sell. Those functions should be overriden by the specific system.


Facility function to set which signal is used to generate buy/sell signal. They are meant to be used in initialize only if long_signal and short_signal are not overriden.

$system->precalculate_all($calc) =item $system->precalculate_interval($calc, $first, $last)

If you run a system on a long period of time you may want to precalculate all the indicators in order to benefit of possible optimizations. This is the role of those 2 functions.


Return an object OrderFactory that can be used if no other objects was to be used.

Functions to manage a repository of systems

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

Create a new Systems with the given arguments. $args is optional.