NAME

Finance::InteractiveBrokers::API - Convenience functions for working with the InteractiveBrokers API

SYNOPSIS

my $ibapi = Finance::InteractiveBrokers::API->new(
    version => '9.64',          # API version
);

my @api_versions       = $ibapi->api_versions();
my @methods            = $ibapi->methods();
my @events             = $ibapi->events();
my @events_and_methods = $ibapi->everything();
my $bool               = $ibapi->is_method( 'reqTickPrice' );
my $bool2              = $ibapi->is_event( 'currentTime' );
my $bool3              = $ibapi->in_api( 'anything' );
my $api_version        = $ibapi->api_version();

DESCRIPTION

This module describes and enumerates the InteractiveBrokers API through successive revisions.

It is not very useful on its own, and was designed to be used by Finance::InteractiveBrokers::SWIG and POE::Component::Client::InteractiveBrokers to reduce maintenance, by isolating the API description for each revision into one single location.

This module will ideally be updated each time new versions of the IB API are released. If the author gets hit by a bus, there is enough documentation contained herein to make the changes yourself.

CONSTRUCTOR

new()

my $ibapi = Finance::InteractiveBrokers::API->new(
    version => '9.64',          # API version
);

Create a new Finance::InteractiveBrokers object.

ARGUMENTS:

version => $scalar [ Default: 9.64 ]

The API version you wish to refer to.

RETURNS: blessed $object, or undef on failure.

initialize()

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

Initialize the object. If you are subclassing, override this, not "new()".

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

RETURNS: %HASH of any leftover arguments.

METHODS

api_versions()

my @api_versions = $ibapi->api_versions();

Get a list of all API versions that can be described by this module.

ARGUMENTS: None.

RETURNS: @ARRAY of API versions.

NOTE: api_versions() also works as a class method, and can be optionally imported via:

use Finance::InteractiveBrokers::API qw( api_versions );

versions()

An alias for "api_versions()".

methods()

my @methods = $ibapi->methods();

Get a list of methods in the constructor-specified version of the API.

ARGUMENTS: None.

RETURNS: @ARRAY of all API method names in this version.

events()

my @events = $ibapi->events();

Get a list of events in the constructor-specified version of the API.

ARGUMENTS: None.

RETURNS: @ARRAY of all API events in this version.

everything()

my @events_and_methods = $ibapi->everything();

Get a list of both methods and events in the constructor-specified version of the API.

ARGUMENTS: None.

RETURNS: @ARRAY of all API methods and events in this version.

is_method()

my $bool = $ibapi->is_method( 'reqTickPrice' );

Check if a named method exists in the constructor-specified version of the API.

ARGUMENTS:

$method_name

The method name you wish to query.

RETURNS: TRUE or FALSE (well, 1 or 0).

is_event()

my $bool = $ibapi->is_event( 'currentTime' );

Check if a named event exists in the constructor-specified version of the API.

ARGUMENTS:

$event_name

The event name you wish to query.

RETURNS: TRUE or FALSE (well, 1 or 0).

in_api()

my $bool = $ibapi->in_api( 'anything' );

Check if a named method or event exists in the constructor-specified version of the API. Probably useless; just here for completeness.

ARGUMENTS:

$name

The method or event name you wish to query.

RETURNS: TRUE or FALSE (well, 1 or 0).

api_version()

my $ibapi       = Finance::InteractiveBrokers::API->new( version => '9.64' );
my $api_version = $ibapi->api_version();     # will return 9.64

Get the API version described by this object instance.

ARGUMENTS: None.

RETURNS: The API version as a string (e.g. '9.64').

version()

An alias for "api_version()".

SEE ALSO

Alien::InteractiveBrokers

POE::Component::Client::InteractiveBrokers

Finance::InteractiveBrokers::SWIG

Finance::InteractiveBrokers::Java

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

AUTHORS

Jason McManus, <infidel at cpan.org>

BUGS

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

SUPPORT

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

perldoc Finance::InteractiveBrokers::API

You can also look for information at:

LICENSE AND COPYRIGHT

Copyright (c) 2010-2013 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.