App/Chart/Suffix/KCBT.pm untested

filter: Statementstmt 0.0% 0 / 41 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 10 Podpod n/a totaltotal 0.0% 0 / 51 CC 1 SCAR 6.9
CC
1
Cov
0%
BEGIN
2.0
BEGIN
2.0
BEGIN
2.0
CRAP 2.0
1 # Kansas City Board of Trade (KCBT) setups.
2  
3 # Copyright 2005, 2006, 2007, 2008, 2009 Kevin Ryde
4  
5 # This file is part of Chart.
6 #
7 # Chart is free software; you can redistribute it and/or modify it under the
8 # terms of the GNU General Public License as published by the Free Software
9 # Foundation; either version 3, or (at your option) any later version.
10 #
11 # Chart is distributed in the hope that it will be useful, but WITHOUT ANY
12 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
13 # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
14 # details.
15 #
16 # You should have received a copy of the GNU General Public License along
17 # with Chart. If not, see <http://www.gnu.org/licenses/>.
18  
19 package App::Chart::Suffix::KCBT;
20 use 5.006;
21 use strict;
22 use warnings;
23 use Locale::TextDomain 'App-Chart';
24  
25 use App::Chart;
26 use App::Chart::Barchart;
27 use App::Chart::Suffix::MGEX;
28 use App::Chart::Sympred;
29 use App::Chart::TZ;
30 use App::Chart::Weblink;
31  
32  
33 our $timezone_kansas = App::Chart::TZ->new
34 (name => __('Kansas City'),
35 # no separate Olson entry for Kansas City
36 choose => [ 'America/Kansas_City', 'America/Chicago'],
37 fallback => 'CST+6');
38  
39 my $pred = App::Chart::Sympred::Suffix->new ('.KCBT');
40 $timezone_kansas->setup_for_symbol ($pred);
41  
42 # (source-help! kcbt-symbol?
43 # (__p('manual-node','Kansas City Board of Trade'))
44  
45  
46 $App::Chart::Barchart::fiveday_pred->add ($pred);
47  
48  
49 #------------------------------------------------------------------------------
50 # weblink - contract specs
51  
52 my %weblink_url = ('KW' => 'http://www.kcbt.com/contract_wheat.html',
53 'KE' => 'http://www.kcbt.com/symbols_trading_hours.html',
54 'MV' => 'http://www.kcbt.com/symbols_trading_hours.html');
55 App::Chart::Weblink->new
56 (pred => $pred,
57 name => __('KCBT _Contract Specifications'),
58 desc => __('Open web browser at the Kansas City Board of Trade contract specifications for this commodity'),
59 proc => sub {
60 my ($symbol) = @_;
61 return $weblink_url{App::Chart::symbol_commodity ($symbol)};
62 });
63  
64  
65 #-----------------------------------------------------------------------------
66 # intraday
67 #
68 # Alternately to do it with the main App::Chart::Barchart
69 # $App::Chart::Barchart::intraday_pred->add ($pred);
70 #
71  
72 App::Chart::Suffix::MGEX::barchart_customer_intraday
73 ($pred,
74 'http://customer1.barchart.com/cgi-bin/mri/kcbtchart.htx?page=chart&code=mfo&org=com&crea=Y');
75  
76 # (lambda (symbol)
77 # (let ((date-time (kcbt-quote-adate-time symbol)))
78 # (set-first! date-time (adate->tdate (first date-time)))
79 # date-time))
80  
81 1;
82 __END__