| 1 | # Central Japan Commodity Exchange setups. -*- coding: shift_jis -*- | ||
| 2 | |||
| 3 | # Copyright 2005, 2006, 2007, 2008, 2009, 2010, 2016 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 | ||
| 8 | # the terms of the GNU General Public License as published by the Free | ||
| 9 | # Software Foundation; either version 3, or (at your option) any later | ||
| 10 | # version. | ||
| 11 | # | ||
| 12 | # Chart is distributed in the hope that it will be useful, but WITHOUT ANY | ||
| 13 | # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS | ||
| 14 | # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more | ||
| 15 | # details. | ||
| 16 | # | ||
| 17 | # You should have received a copy of the GNU General Public License | ||
| 18 | # along with Chart. If not, see <http://www.gnu.org/licenses/>. | ||
| 19 | |||
| 20 | |||
| 21 | package App::Chart::Suffix::CCOM; | ||
| 22 | use 5.010; | ||
| 23 | use strict; | ||
| 24 | use warnings; | ||
| 25 | use Locale::TextDomain 'App-Chart'; | ||
| 26 | |||
| 27 | use App::Chart::Glib::Ex::MoreUtils; | ||
| 28 | use App::Chart; | ||
| 29 | use App::Chart::Barchart; | ||
| 30 | use App::Chart::Sympred; | ||
| 31 | use App::Chart::TZ; | ||
| 32 | use App::Chart::Weblink; | ||
| 33 | use App::Chart::Yahoo; | ||
| 34 | |||
| 35 | |||
| 36 | # think GBL bund, GBM bobl and GBS schatz which traded on european time now | ||
| 37 | # delisted | ||
| 38 | # | ||
| 39 | my $pred = App::Chart::Sympred::Suffix->new ('.CCOM'); | ||
| 40 | App::Chart::TZ->tokyo->setup_for_symbol ($pred); | ||
| 41 | |||
| 42 | # (source-help! ccom-symbol? | ||
| 43 | # (__p('manual-node','Central Japan Commodity Exchange')) | ||
| 44 | |||
| 45 | |||
| 46 | #------------------------------------------------------------------------------ | ||
| 47 | # weblink - contract specs | ||
| 48 | # | ||
| 49 | # eg. http://www.c-com.or.jp/public_html_e/guide/kerosene.php | ||
| 50 | |||
| 51 | my %weblink_mung = ('ferrousscrap' => 'scrap', | ||
| 52 | 'rubberindex' => 'rubberIndex'); | ||
| 53 | my %weblink_ja_mung = ('gasoline' => 'gas', | ||
| 54 | 'kerosene' => 'heating', | ||
| 55 | 'gasoil' => 'diesel', | ||
| 56 | 'eggs' => 'egg'); | ||
| 57 | App::Chart::Weblink->new | ||
| 58 | (pred => $pred, | ||
| 59 | name => __('C-COM _Contract Specifications'), | ||
| 60 | desc => __('Open web browser at the Central Japan Commodities Exchange contract specifications for this commodity'), | ||
| 61 | proc => sub { | ||
| 62 | my ($symbol) = @_; | ||
| 63 | my $code = lc(App::Chart::symbol_commodity($symbol)); | ||
| 64 | $code =~ s/ //g; | ||
| 65 | my $lang = App::Chart::Glib::Ex::MoreUtils::lang_select (ja => '', | ||
| 66 | en => '_e'); | ||
| 67 | $code = $weblink_mung{$code} // $code; | ||
| 68 | if ($lang eq '') { $code = $weblink_ja_mung{$code} // $code; } | ||
| 69 | return "http://www.c-com.or.jp/public_html$lang/guide/$code.php"; | ||
| 70 | }); | ||
| 71 | |||
| 72 | |||
| 73 | 1; | ||
| 74 | __END__ |