The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Finance::Robinhood::Order - Securities trade order

SYNOPSIS

    use Finance::Robinhood;

    my $rh = Finance::Robinhood->new( token => ... );
    my $bill = $rh->instrument('MSFT');
    my $order = $MC->place_buy_order({type => 'market', quantity => 3000, instrument => $bill});
    $order->cancel(); # Oh, wait!

DESCRIPTION

This class represents a single buy or sell order. Objects are usually created by Finance::Robinhood with either the place_buy_order( ... ). or place_sell_order( ) methods.

METHODS

This class has several getters and a few methods as follows...

account( )

    my $acct = $order->account();

Returns the Finance::Robinhood::Account object related to this order.

executions( )

Returns order executions as a list of hashes which contain the following keys:

    price              The exact price per share
    quantity           The number of shares transfered in this execution
    settlement_date    Date on which the funds of this transaction will settle
    timestamp          When this execution took place

cancel( )

    $order->cancel( ); # Nm! I want to keep these!

If the order can be cancelled (has not be executed in completion, etc.), you may cancel it with this.

position( )

Returns a Finance::Robinhood::Position object related to this order's security.

average_price( )

Average price paid for all shares executed in this order.

id( )

    my $id = $order->id();
    # ...later...
    my $order = $rh->order( $id );

The order ID for this particular order. Use this for locating the order again.

fees( )

Total amount of fees related to this order.

price( )

Total current value of the order.

quantity( )

Total number of shares ordered or put up for sale.

cumulative_quantity

Total number of shares which have executed so far.

reject_reason( )

If the order was rejected (see state( )), the reason will be here.

side( )

Indicates which side of the deal you were on: buy or sell.

state( )

The current state of the order. For example, completly executed orders have a filled state. The current state may be any of the following:

    queued
    unconfirmed
    confirmed
    partially_filled
    filled
    rejected
    cancelled
    failed

stop_price( )

Stop limit and stop loss orders will have a defined stop price.

time_in_force( )

This may be one of the following:

    gfd     Good For Day
    gtc     Good Til Cancelled
    fok     Fill or Kill
    ioc     Immediate or Cancel
    opg

trigger( )

May be one of the following:

    immediate
    on_close
    stop

Note: Support for opg orders may indicate support for loo and moo triggers but I have yet to test it.

type( )

May be one of the following:

    market
    limit
    stop_limit
    stop_loss

created_at( )

The timestamp when the order was placed.

last_transaction_at( )

The timestamp of the most recent execution.

upated_at( )

Timestamp of the last change made to this order.

LEGAL

This is a simple wrapper around the API used in the official apps. The author provides no investment, legal, or tax advice and is not responsible for any damages incured while using this software. Neither this software nor its author are affiliated with Robinhood Financial LLC in any way.

For Robinhood's terms and disclosures, please see their website at http://robinhood.com/

LICENSE

Copyright (C) Sanko Robinson.

This library is free software; you can redistribute it and/or modify it under the terms found in the Artistic License 2.

Other copyrights, terms, and conditions may apply to data transmitted through this module. Please refer to the LEGAL section.

AUTHOR

Sanko Robinson <sanko@cpan.org>