GeniusTrader/OrderFactory/MaximumSlippage.pm untested

filter: Statementstmt 0.0% 0 / 16 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 5 Podpod 0.0% 0 / 2 totaltotal 0.0% 0 / 23 CC 1 SCAR 6.9
CC
1
Cov
0%
create_buy_order
2.0
create_sell_order
2.0
BEGIN
2.0
CRAP 2.0
1 package Finance::GeniusTrader::OrderFactory::MaximumSlippage;
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 # Standards-Version: 1.0
8  
9 use strict;
10 use vars qw(@ISA @NAMES @DEFAULT_ARGS);
11  
12 use Finance::GeniusTrader::OrderFactory;
13  
14 @ISA = qw(Finance::GeniusTrader::OrderFactory);
15 @NAMES = ("MaximumSlippage");
16 @DEFAULT_ARGS = ();
17  
18 =head1 NAME
19  
20 Finance::GeniusTrader::OrderFactory::MaximumSlippage
21  
22 =head1 DESCRIPTION
23  
24 In a Maximum Slippage test, we rig the software so that buy orders always
25 suffer the maximum possible slippage : all buys occurs at the High of the
26 day, and similarly all sells occurs at the Low of the day.
27  
28 This idea came from author Fred Gehm; it's a torture test designed to see
29 whether a system is robust against slippage.
30  
31 =cut
32  
33 sub create_buy_order {
34 my ($self, $calc, $i, $sys_manager, $pf_manager) = @_;
35  
36 return $pf_manager->virtual_buy_at_high($calc, $sys_manager->get_name);
37 }
38  
39 sub create_sell_order {
40 my ($self, $calc, $i, $sys_manager, $pf_manager) = @_;
41  
42 return $pf_manager->virtual_sell_at_low($calc, $sys_manager->get_name);
43 }
44  
45 1;