Jason McManus > Finance-InteractiveBrokers-SWIG-0.10 > Finance::InteractiveBrokers::SWIG::EventHandler

Download:
Finance-InteractiveBrokers-SWIG-0.10.tar.gz

Dependencies

Annotate this POD

CPAN RT

Open  0
View/Report Bugs
Module Version: 0.10   Source   Latest Release: Finance-InteractiveBrokers-SWIG-0.13

NAME ^

Finance::InteractiveBrokers::SWIG::EventHandler - Event Handler base class

SYNOPSIS ^

Create a subclass of this class:

    package MyEventHandler;

    use base qw( Finance::InteractiveBrokers::SWIG::EventHandler );
    use strict;
    use warnings;

    my $handler = MyEventHandler->new();

    sub currentTime {
        # Do something with received time
    }

    # ...

Then, pass your $handler object into "new()" in Finance::InteractiveBrokers::SWIG.

DESCRIPTION ^

This module is designed as a base class for catching the events that the InteractiveBrokers API returns.

It is required to be subclassed with the event handler methods filled in, to trap the returned events so you can do something with them (e.g. save into a database, analyze, etc).

An object of your subclass should be instantiated, and passed in as an argument to "new" in Finance::InteractiveBrokers::SWIG.

There is a well-commented example subclass in the examples/ directory of this module's distribution, on which you must base your subclass.

CONSTRUCTOR ^

new()

    my $handler = MyEventHandler->new();

ARGUMENTS: None.

RETURNS: blessed $object, or undef on failure.

initialize()

    my %leftover = $self->initialize( %ARGS );

Initialize the object. When subclassing, override this (if desired), not "new()".

ARGUMENTS: %HASH of arguments passed into "new()"

RETURNS: %HASH of any leftover arguments.

METHODS ^

override()

    my @api_methods = $handler->override();

or

    my @api_methods =
        Finance::InteractiveBrokers::SWIG::EventHandler::override();

Get a list of IB API events that you MUST override in your subclass. These correspond 1:1 to events in the IB API, but they are dynamically dispatched, so you will not find sub definitions in the source.

ARGUMENTS: None.

RETURNS: @ARRAY of IB API events that must be overridden.

NOTE: You can also get a list of them from the command line, via:

    perl -MFinance::InteractiveBrokers::SWIG::EventHandler -e'print Finance::InteractiveBrokers::SWIG::EventHandler::override'

api_version()

    my $version = $handler->api_version();

Get the IB API version this module was compiled against.

RETURNS: $scalar containing the version as a string, something like '9.64'.

THE INTERACTIVE BROKERS API ^

The IB API is not described in this documentation. You should refer to their website ("SEE ALSO") for notes on how to use it and what methods and events are available.

SEE ALSO ^

Finance::InteractiveBrokers::SWIG

Alien::InteractiveBrokers

POE::Component::Client::InteractiveBrokers

Finance::InteractiveBrokers::API

Finance::InteractiveBrokers::Java

http://www.swig.org/ - SWIG, the Simplified Wrapper and Interface Generator

The POE documentation, POE::Kernel, POE::Session

http://poe.perl.org/ - All about the Perl Object Environment (POE)

http://www.interactivebrokers.com/ - The InteractiveBrokers website

http://www.interactivebrokers.com/php/apiUsersGuide/apiguide.htm - The IB API documentation

The examples/ directory of this module's distribution

AUTHORS ^

Jason McManus, <infidel at cpan.org>

BUGS ^

Please report any bugs or feature requests to bug-finance-interactivebrokers-swig at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Finance-InteractiveBrokers-SWIG. The authors will be notified, and then you'll automatically be notified of progress on your bug as changes are made.

If you are sending a bug report, please include:

This will be of great assistance in troubleshooting your issue.

SUPPORT ^

You can find documentation for this module with the perldoc command.

    perldoc Finance::InteractiveBrokers::SWIG

You can also look for information at:

LICENSE AND COPYRIGHT ^

Copyright (c) 2010-2012 Jason McManus

This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.

See http://dev.perl.org/licenses/ for more information.

The authors are not associated with InteractiveBrokers, and as such, take no responsibility or provide no warranty for your use of this module or the InteractiveBrokers service. You do so at your own responsibility. No warranty for any purpose is either expressed or implied by your use of this module suite.

The data from InteractiveBrokers are under an entirely separate license that varies according to exchange rules, etc. It is your responsibility to follow the InteractiveBrokers and exchange license agreements with the data.

syntax highlighting: