Finance-Alpaca
view release on metacpan or search on metacpan
lib/Finance/Alpaca/DataStream.pm view on Meta::CPAN
You can also omit either one of them (C<trades>, C<quotes>, or C<bars>) if you
donât want to subscribe to any symbols in that category but be sure to
include at least one of the three.
=head2 C<subscriptions( )>
my $current = $stream->subscriptions( );
After subscribing or unsubscribing, our websocket will receive a message that
describes your current list of subscriptions. You may access this data with
this method.
=head2 C<unsubscribe( ... )>
$stream->unsubscribe(
quotes => ['MSFT']
);
Much like subscribe you can also send an unsubscribe message that subtracts the
list of subscriptions specified from your current set of subscriptions.
This method accepts the following parameters:
=over
=item C<bars> - List of ticker symbols
=item C<quotes> - List of ticker symbols
=item C<trades> - List of ticker symbols or C<*>
=back
You can also omit either one of them (C<trades>, C<quotes>, or C<bars>) if you
donât want to subscribe to any symbols in that category but be sure to
include at least one of the three.
=head1 Errors
Unhandled errors are passed directly to the callback. Possible errors
include...
=over
=item C<400>
{ T => 'error', code => 400, msg => 'invalid syntax' }
The message you sent to the server did not follow the specification.
=item C<401>
{ T => 'error', code => 401, msg => 'not authenticated' }
You have attempted to subscribe or unsubscribe before authentication.
=item C<402>
{ T => 'error', code => 402, msg => 'auth failed' }
You have provided invalid authentication credentials.
=item C<403>
{ T => 'error', code => 403, msg => 'already authenticated' }
You have already successfully authenticated during your current session.
=item C<404>
{ T => 'error', code => 404, msg => 'auth timeout' }
You failed to successfully authenticate after connecting. You have a few
seconds to authenticate after connecting.
=item C<405>
{ T => 'error', code => 405, msg => 'symbol limit exceeded' }
The symbol subscription request you sent would put you over the limit set by
your subscription package. If this happens your symbol subscriptions are the
same as they were before you sent the request that failed.
=item C<406>
{ T => 'error', code => 406, msg => 'connection limit exceeded' }
You already have an ongoing authenticated session.
=item C<407>
{ T => 'error', code => 407, msg => 'slow client' }
You may receive this if you are too slow to process the messages sent by the
server. Please note that this is not guaranteed to arrive before you are
disconnected to avoid keeping slow connections active forever.
=item C<408>
{ T => 'error', code => 408, msg => 'v2 not enabled' }
Your account does not have access to Data v2.
=item C<409>
{ T => 'error', code => 409, msg => 'insufficient subscription' }
You have attempted to access a data source not available in your subscription
package.
=item C<500>
{ T => 'error', code => 500, msg => 'internal error' }
An unexpected error occurred on our end and Alpaca is investigating the issue.
=back
=head1 LICENSE
Copyright (C) Sanko Robinson.
( run in 0.453 second using v1.01-cache-2.11-cpan-cdf2f3d4e48 )