30 Apr 2021 22:56:50 UTC
- Distribution: Finance-Alpaca
- Module version: 0.9902
- Source (raw)
- Browse (raw)
- How to Contribute
- Testers (99 / 0 / 20)
- KwaliteeBus factor: 1
- 80.44% Coverage
- License: artistic_2
- Perl: v5.22.0
- Activity24 month
- Download (39.39KB)
- MetaCPAN Explorer
- Subscribe to distribution
- This version
- Latest versionSANKO Sanko Robinson
Finance::Alpaca::Struct::Order - A Single Order Object
use Finance::Alpaca; my @orders = Finance::Alpaca->new( ... )->orders( status => 'all' ); say $orders->id;
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.
The following properties are contained in the object.
id- Order ID; UUID
client_order_id- Client unique order ID
created_at- Timestamp as Time::Moment object
updated_at- Timestamp as Time::Moment object if available
submitted_at- Timestamp as Time::Moment object if available
filled_at- Timestamp as Time::Moment object if available
expired_at- Timestamp as Time::Moment object if available
canceled_at- Timestamp as Time::Moment object if available
failed_at- Timestamp as Time::Moment object if available
replaced_at- Timestamp as Time::Moment object if available
replaced_by- The order ID that this order was replaced by if available; UUID
replaces- The order ID that this order replaces if available; UUID
asset_id- Asset ID; UUID
symbol- Asset symbol
asset_class- Asset class
notional- Ordered notional amount. If entered,
qty( )will be undefined. Can take up to
qty- Ordered quantity. If entered,
notional( )will be undefined. Can take up to
filled_qty- Filled quantity
filled_avg_price- Filled average price
oto. For details of non-simple order classes, please see Bracket Order Overview.
fok. See Orders page
limit_price- Limit price if applicable
stop_price- Stop price if applicable
status- See Orders page
extended_hours- Boolean value indicating whether the order is eligible for execution outside regular trading hours
legs- List of Orders; When querying non-simple
order_classorder in a nested style, an array 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.
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.
Sanko Robinson <email@example.com>
Module Install Instructions
To install Finance::Alpaca, copy and paste the appropriate command in to your terminal.
perl -MCPAN -e shell install Finance::Alpaca
For more information on module installation, please visit the detailed CPAN module installation guide.