NAME

Finance::Robinhood::Equity::Order - Represents a Single Equity Order

SYNOPSIS

use Finance::Robinhood;
my $rh = Finance::Robinhood->new->login('user', 'pass');
my $orders = $rh->equity_orders();

for my $order ($orders->all) {
    $order->cancel if $order->can_cancel;
}

METHOD

can_cancel( )

Returns true if the order can be cancelled.

account( )

Returns the related Finance::Robinhood::Equity::Account object.

position( )

Returns the related Finance::Robinhood::Equity::Position object.

average_price( )

Average price per share for all executions so far.

cancel( )

$order->cancel();

If the order can be cancelled, this method will do it.

Be aware that the order is still active for about a second after this is called so add a 'smart' delay here and then call reload( ) to update the object correctly.

created_at( )

Returns a Time::Moment object.

cumulative_quantity( )

Number of shares that have been bought or sold with this order's execution(s) so far.

executions( )

Returns a list of related Finance::Robinhood::Equity::Order::Execution objects if applicable.

extended_hours( )

Returns a true value if this order is set to execute during extended hours and pre-market.

fees( )

Fees charged by Robinhood. Always 0.00.

id( )

UUID used to identify this specific order.

instrument( )

Returns the related Finance::Robinhood::Equity::Instrument object.

last_transaction_at( )

Returns a Time::Moment object if applicable.

override_day_trade_checks( )

A boolean value indicating whether this order bypassed PDT checks.

override_dtbp_checks( )

A boolean value indicating whether this order bypassed day trade buying power checks.

Risky Regulation T violation warning!

price( )

The price used as an exact limit (for limit and stop-limit orders) or as the price to collar from (for market and stop-loss orders).

quantity( )

Returns the total number of shares in this order.

ref_id( )

Client generated UUID is returned.

reject_reason( )

If the order was rejected, this will be filled with the reason.

response_category( )

Returns the response category if applicable.

side( )

Indicates if this is an order to buy or sell.

state( )

One of the following:

queued
new
unconformed
confirmed
partially_filled
filled
rejected
canceled
failed
voided

stop_price( )

Returns a float if the trigger type is stop, otherwise, undef.

time_in_force( )

Returns the Time-in-Force value. gfd (good for day) or gtc (good 'til cancelled).

trigger( )

Returns the trigger. stop or immediate.

type( )

Returns the order type. limit or market.

updated_at( )

Returns a Time::Moment object.

reload( )

$order->reload();

Reloads the data for this order from the API server.

Use this if you think the status or some other info might have changed.

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 incurred while using this software. This software is not affiliated with Robinhood Financial LLC in any way.

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

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>