-
-
16 Nov 2014 15:40:09 UTC
- Distribution: Finance-StockAccount
- Module version: 0.01
- Source (raw)
- Browse (raw)
- Changes
- How to Contribute
- Issues
- Testers (600 / 0 / 0)
- Kwalitee
Bus factor: 0- 73.23% Coverage
- License: unknown
- Perl: v5.6.0
- Activity
24 month- Tools
- Download (56.2KB)
- MetaCPAN Explorer
- Permissions
- Subscribe to distribution
- Permalinks
- This version
- Latest version
- Dependencies
- Carp
- Time::Moment
- and possibly others
- Reverse dependencies
- CPAN Testers List
- Dependency graph
NAME
Finance::StockAccount::AccountTransaction
SYNOPSIS
my $stock = Finance::StockAccount::Stock->new({ symbol => 'FTR', exchange => 'NASDAQ', }); my $at = Finance::StockAccount::AccountTransaction->new({ tm => $tm, action => 'buy', stock => $stock, quantity => 800, price => 7.11, commission => 8.95, regulatoryFees => 0.01, }); $at->accounted(100); print $st->price(), "\n"; # prints number 7.11
PROPERTIES
These are the public properties of a StockAccount::Transaction object:
date # 'presumed' DateTime object. See http://datetime.perl.org/wiki/datetime/dashboard and discussion below. action # One of module constants BUY, SELL, SHORT, COVER stock # A Finance::StockAccount::Stock object quantity # How many shares were bought or sold, e.g. 100 or 5. price # Numeric representation of price, e.g. 4.65 instead of the string '$4.65'. commission # Numeric representation of commission in same currency, e.g. 8.95 instead of the string '$8.95'. regulatoryFees # Numeric representation of the regulatory fees, see section on "Regulatory Fees" below. otherFees # Numeric aggregation of any other fees not included in commission and regulatory fees.
Any public property can be instantiated in the
new
method, set with a method matching the name of the property, such as$st-
date($dt)>, or set with theset
method, e.g.$st-
set({date => $dt})>, as specified further in the method description below.Public properties can also be retrieved by the same method matching the name of the property when no parameter is passed, e.g.
$st-
date()>. Or by theget
method with a string naming the property, e.g.$st-
get('price')>.All properties can also be read or written directly with a hash dereference. Some people don't consider this good object-oriented practice, but I won't stop you if that's what you want to do. E.g.
$st-
{date} = $dt> or$st-
{price}>.REGULATORY FEES
In the United States the Securities and Exchange Commission imposes regulatory fees on stock brokers or dealers. Instead of paying these with their profits, these for-profit companies often pass these fees onto their customers directly. The
regulatoryFees
property could be used for similar purposes in other jurisdictions.See http://www.sec.gov/answers/sec31.htm for more information.
Module Install Instructions
To install Finance::StockAccount, copy and paste the appropriate command in to your terminal.
cpanm Finance::StockAccount
perl -MCPAN -e shell install Finance::StockAccount
For more information on module installation, please visit the detailed CPAN module installation guide.