The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Finance::Bank::US::ShareBuilder - Check positions and transactions for US ShareBuilder investment accounts

VERSION

Version 0.01

SYNOPSIS

  use Finance::Bank::US::ShareBuilder;

  my $sb = Finance::Bank::US::ShareBuilder->new(
    username => 'XXXXX', # Saver ID or customer number
    password => 'XXXXXXXXXX',
    image => 'I*******.jpg', # The filename of your verification image
    phrase => 'XXXXXXXXXXXXXX', # Verification phrase
  );

  my %accounts = $sb->accounts;
  for(keys %accounts) {
      printf "%10s %-15s %11s\n", $_, $accounts{$_}{nickname},
          '$'.sprintf('%.2f', $accounts{$_}{balance});
  }
  $sb->print_positions($sb->positions);

DESCRIPTION

This module provides methods to access data from US ShareBuilder accounts, including positions and recent transactions, which can be provided in OFX format (see Finance::OFX) or in parsed lists.

There is no support yet for executing transactions. Code for listing sell transactions was written by analogy based on the OFX spec and has not been tested, due to a lack of data.

METHODS

new( username => '...', password => '...', image => '...', phrase => '...' )

Return an object that can be used to retrieve positions and transactions.

accounts( )

Retrieve a list of accounts:

  ( '####' => { number => '####', type => '...', nickname => '...', balance => ###.## },
    ...
  )

positions( $account )

List positions for an account:

  ( { symbol => 'PERL', description => 'Perl, Inc.', quantity => 3.1416,
            value => 271.83, quote => 86.52, cost_per_share => 73.12,
            basis => 229.71, change => 42.12, change_pct => 18.33 }
    ...
  )

Pretty-print a set of positions as returned by positions().

recent_transactions( $account, $days )

Retrieve a list of transactions in OFX format for the given account for the past number of days (default: 30).

transactions( $account, $from, $to )

Retrieve a list of transactions in OFX format for the given account in the given time frame (default: past three months).

transaction_list( $account, $from, $to )

Return transactions as a list instead of as OFX.

Pretty-print a set of transactions as returned by transaction_list().

usd( $dollars )

Shortcut to format a floating point amount as dollars (dollar sign, commas, and two decimal places).

AUTHOR

This version by Steven N. Severinghaus <sns-perl@severinghaus.org>

COPYRIGHT

Copyright (c) 2011 Steven N. Severinghaus. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

SEE ALSO

Finance::Bank::US::INGDirect, Finance::OFX::Parse