NAME
Finance::Alpaca::Struct::Order - A Single Order Object
SYNOPSIS
use Finance::Alpaca;
my @orders = Finance::Alpaca->new( ... )->orders( status => 'all' );
say $orders[0]->id;
DESCRIPTION
The orders API allows a user to monitor, place and cancel their orders with Alpaca. Each order has a unique identifier provided by the client. This client-side unique order ID will be automatically generated by the system if not provided by the client, and will be returned as part of the order object along with the rest of the fields described below. Once an order is placed, it can be queried using the client-side order ID to check the status. Updates on open orders at Alpaca will also be sent over the streaming interface, which is the recommended method of maintaining order state.
Properties
The following properties are contained in the object.
$trade->id();
id
- Order ID; UUIDclient_order_id
- Client unique order IDcreated_at
- Timestamp as Time::Moment objectupdated_at
- Timestamp as Time::Moment object if availablesubmitted_at
- Timestamp as Time::Moment object if availablefilled_at
- Timestamp as Time::Moment object if availableexpired_at
- Timestamp as Time::Moment object if availablecanceled_at
- Timestamp as Time::Moment object if availablefailed_at
- Timestamp as Time::Moment object if availablereplaced_at
- Timestamp as Time::Moment object if availablereplaced_by
- The order ID that this order was replaced by if available; UUIDreplaces
- The order ID that this order replaces if available; UUIDasset_id
- Asset ID; UUIDsymbol
- Asset symbolasset_class
- Asset classnotional
- Ordered notional amount. If entered,qty( )
will be undefined. Can take u pto9
decimal places.qty
- Ordered quantity. If entered,notional( )
will be undefined. Can take up to9
decimal places.filled_qty
- Filled quantityfilled_avg_price
- Filled average priceorder_class
-simple
,bracket
,oco
, oroto
. For details of non-simple order classes, please see Bracket Order Overview.type
-market
,limit
,stop
,stop_limit
, ortrailing_stop
side
-buy
orsell
time_in_force
-day
,gtc
,opg
,cls
,ioc
,fok
. See Orders pagelimit_price
- Limit price if applicablestop_price
- Stop price if applicablestatus
- See Orders pageextended_hours
- Boolean value indicating whether the order is eligible for execution outside regular trading hourslegs
- List of Orders; When querying non-simpleorder_class
order in a nested style, an arry of Order objects associated with this order. Otherwise, undefined.trail_percent
- The percent value away from the high water mark for trailing stop orders, if applicable.trail_price
- The dollar value away from the hight water mark for trailing stop orders, if available.hwm
- The highest (lowest) market price seen since the trailing stop order was submitted.
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.
AUTHOR
Sanko Robinson <sanko@cpan.org>