GeniusTrader/Brokers.pm untested

filter: Statementstmt 0.0% 0 / 28 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 13 Podpod 0.0% 0 / 7 totaltotal 0.0% 0 / 48 CC 1 SCAR 6.9
CC
1
Cov
0%
calculate_order_commission
2.0
calculate_annual_account_charge
2.0
initialize
2.0
CRAP 2.0
1 package Finance::GeniusTrader::Brokers;
2  
3 # Copyright 2000-2002 Raphaƫl Hertzog, Fabien Fulhaber
4 # This file is distributed under the terms of the General Public License
5 # version 2 or (at your option) any later version.
6  
7 use strict;
8 use vars qw(@ISA @EXPORT %OBJECT_REPOSITORY);
9  
10 require Exporter;
11 use Finance::GeniusTrader::Dependency;
12 use Finance::GeniusTrader::Serializable;
13  
14 @ISA = qw(Exporter Finance::GeniusTrader::Dependency Finance::GeniusTrader::Serializable);
15 @EXPORT = qw(&build_object_name &manage_object);
16  
17 use Finance::GeniusTrader::Registry;
18 #ALL# use Log::Log4perl qw(:easy);
19  
20 =head1 NAME
21  
22 Finance::GeniusTrader::Brokers - A module for calculating broker's fee & commissions
23  
24 =head1 DESCRIPTION
25  
26 Brokers rules are used to calculate commissions for each buy/sell order,
27 as well as annual account charge.
28  
29 =over
30  
31 =item C<< $broker->calculate_order_commission($order) >>
32  
33 Return the amount of money ask by the broker for the given order.
34  
35 =cut
36 sub calculate_order_commission {
37 my ($self, $order) = @_;
38  
39 return;
40 }
41  
42 =item C<< $broker->calculate_annual_account_charge($portfolio, $year) >>
43  
44 Return the amount of money ask by the broker for the given year
45 according to the given portfolio.
46  
47 =cut
48 sub calculate_annual_account_charge {
49 my ($self, $portfolio, $year) = @_;
50  
51 return;
52 }
53  
54 # Default initialize that does nothing
55 sub initialize { 1 }
56  
57 # Finance::GeniusTrader::Registry functions
58 sub get_registered_object {
59 Finance::GeniusTrader::Registry::get_registered_object(\%OBJECT_REPOSITORY, @_);
60 }
61 sub register_object {
62 Finance::GeniusTrader::Registry::register_object(\%OBJECT_REPOSITORY, @_);
63 }
64 sub get_or_register_object {
65 Finance::GeniusTrader::Registry::get_or_register_object(\%OBJECT_REPOSITORY, @_);
66 }
67 sub manage_object {
68 Finance::GeniusTrader::Registry::manage_object(\%OBJECT_REPOSITORY, @_);
69 }
70  
71 =pod
72  
73 =back
74  
75 =cut
76 1;