INFIDEL > POE-Component-Client-opentick-0.21 > POE::Component::Client::opentick::Constants



Annotate this POD


Open  0
View/Report Bugs
Module Version: 56   Source  


POE::Component::Client::opentick::Constants - Constants for the opentick POE Component.


 use POE::Component::Client::opentick::Constants;


This module contains all of the constants used by the rest of POE::Component::Client::opentick, and thus is of no use to anything else.

It also rudely exports a bunch of junk into your namespace. This is desirable for the POE component, but why would you want that in your own module?

Don't fiddle with it. Ist easy schnappen der Springenwerk, blowen-fusen und poppen corken mit spitzensparken.


Exports the following methods into the using package's namespace:

$value = OTConstant( $const_name )

Return the value of the named constant.

$cmd_name = OTCommand( $cmd_number )

Return the command name from the constant command number.

$cmd_name = OTCommandList( )

Return a list of all symbolic <CommandType> names.

$value = OTDefault( $value_name )

Return one of the default values by name.

$pack_tmpl = OTTemplate( $tmpl_name )

Return the named pack() template.

$hashref = OTCancel( $cmd_number )

Return a hashref of the command IDs that the supplied $cmd_number can cancel.

Mapped like such:

{ $cmd_number => $TRUE, $cmd_number2 => $TRUE, ... }

It's a hashref for O(1) lookups instead of O(n) list grepping.

$cmd_id = OTCanceller( $cmd_id )

Returns the canceller command ID of the appropriate cancel request for the supplied command ID.

$datatype = OTDatatype( $const_num )

Return a $string representing the datatype for the supplied constant.

$count = OTResponses( $cmd_number )

Return the $count of expected response packets to the specified command.

Possible values and their meanings are:

 undef   Unknown or unlisted number of responses.
 0       No response is generated (OT_HEARTBEAT).
 1       Only one reply packet is generated.
 2       A finite number of response packets are generated.
 3       The stream is continuous until told to shut up.
$boolean = OTCmdStatus( $value )

Return TRUE if the value is a valid CommandStatus.

$boolean = OTMsgType( $value )

Return TRUE if the value is a valid MessageType.

$eventname = OTEvent( $name )

Return actual POE $eventname for symbolic event name constant.

$constname = OTEventByEvent( $eventname )

The reverse of the above.

$constname = OTEventByCommand( $cmd_number )

Returns the POE event to issue for a particular $cmd_number response.

e.g. OTEventByCommand( OTConstants('OT_LOGIN') ) returns 'ot_on_login'

@eventnames = OTEventList( )

Return a list of all actual OTEvent names ( values( %$OTEvents ) ).

$cmd_id = OTDeprecated( $cmd_id )

Return the replacement $cmd_id, if the supplied $cmd_id refers to an Opentick-deprecated command.

Only requestTickStream and requestOptionChain are deprecated right now.

$boolean = OTeod( $value )

Return TRUE if the value specifies End-Of-Data for <DataType>.

$cmd_num = OTAPItoCommand( $api_name )

Return the $command_number for the specified PUBLIC $api_name.

$description = OTQuoteIndicator( $code )

Return the description of the supplied Indicator code from an EQUITY quote, or undef if not found.

$description = OTTradeIndicator( $code )

Return the description of the supplied Indicator code from a TRADE quote, or undef if not found.

$api_name = OTCommandtoAPI( $cmd_id )

Does the reverse of the above.

@fieldnums = OT64bit( $cmd_id )

Return a list of field numbers that are actually supposed to be 64-bit integers for this $cmd_id. This is to simulate 64-bit ints on a 32-bit perl. Returns the empty list if we're compiled with 64-bit ints, or the $cmd_id doesn't require any 64-bit simulation.

Basically, it's used internally and useless for anything else.

$boolean = has_otlib( )

Return TRUE if official opentick libraries were found in @INC.


This module attempts to include the official 'opentick' perl library paths from @INC, to retrieve constant values, and carps the following warning if it is not present:

Official opentick lib not found; using built-in constants.

It is better to use the official opentick library constant values, if you can. I am sure they will strive to be backward-compatible, but I cannot guarantee the values contained herein will always work in the future.

They can be downloaded from:

Install at least opentick::OTConstants to a path in your @INC, and this module will find them. (Read perldoc -q "include path" if you are unsure how to modify your @INC path.)




perldoc lib

perldoc -q "include path"


Jason McManus (INFIDEL) - infidel AT


Copyright (c) Jason McManus

This module may be used, modified, and distributed under the same terms as Perl itself. Please see the license that came with your Perl distribution for details.

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

Further details are available on

syntax highlighting: