Finance::Robinhood::Order - Securities trade order
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!
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.
place_buy_order( ... )
place_sell_order( )
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.
state( )
side( )
Indicates which side of the deal you were on: buy or sell.
buy
sell
The current state of the order. For example, completly executed orders have a filled state. The current state may be any of the following:
filled
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.
opg
loo
moo
type( )
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.
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/
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.
Sanko Robinson <sanko@cpan.org>
To install Finance::Robinhood, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Finance::Robinhood
CPAN shell
perl -MCPAN -e shell install Finance::Robinhood
For more information on module installation, please visit the detailed CPAN module installation guide.