NAME
Finance::Alpaca::Struct::Position - A Single Account Object
SYNOPSIS
use Finance::Alpaca;
my $tsla = Finance::Alpaca->new( ... )->position( 'TSLA' );
say sprintf '%s %f shares of %s', ucfirst $tsla->side, abs $tsla->qty, $tsla->symbol
DESCRIPTION
The positions API provides information about an account’s current open positions. The response will include information such as cost basis, shares traded, and market value, which will be updated live as price information is updated. Once a position is closed, it will no longer be queryable through this API.
Properties
The following properties are contained in the object.
$position->change_today();
asset_id
- Asset ID (UUID)asset_class
- Asset class name (us_equity)exchange
- Exchange name of the assetsymbol
- Symbol name of the assetavg_entry_price
- Average entry price of the positionside
- "long"market_value
- Total dollar amount of the positioncost_basis
- Total cost basis in dollarunrealized_pl
- Unrealized profit/loss in dollarsunrealized_plpc
- Unrealized profit/loss percent (by a factor of 1)unrealized_intraday_pl
- Unrealized profit/loss in dollars for the dayunrealized_intraday_plpc
- Unrealized profit/loss percent (by a factor of 1)change_today
- Percent change from last day price (by a factor of 1)
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>