App-Chart

 view release on metacpan or  search on metacpan

lib/App/Chart/Suffix/NYM.pm  view on Meta::CPAN

use strict;
use warnings;
use Locale::TextDomain 'App-Chart';

use App::Chart;
use App::Chart::Barchart;
use App::Chart::Sympred;
use App::Chart::TZ;
use App::Chart::Weblink;
use App::Chart::Yahoo;


my $pred = App::Chart::Sympred::Regexp->new (qr/\.(NYM|CMX)$/);
App::Chart::TZ->newyork->setup_for_symbol ($pred);

$App::Chart::Yahoo::latest_pred->add ($pred);
$App::Chart::Barchart::intraday_pred->add ($pred);
$App::Chart::Barchart::fiveday_pred->add ($pred);


#------------------------------------------------------------------------------
# weblink - contract specs

App::Chart::Weblink->new
  (pred => $pred,
   name => __('NYMEX _Contract Specifications'),
   desc => __('Open web browser at the NYMEX/COMEX contract specifications for this commodity'),
   proc => sub {
     my ($symbol) = @_;
     return 'http://www.nymex.com/'
       . URI::Escape::uri_escape (App::Chart::symbol_commodity ($symbol))
         . '_spec.aspx';
   });

#------------------------------------------------------------------------------
# barchart

App::Chart::Barchart::commodity_mung
  ($pred,
   # COMEX - no transforms
   # "HG" high grade copper
   # "GC" gold
   # "SI" silver
   # "AL" aluminium
   'QS' => 'AM',  # asian gold

   # NYMEX - no transformations
   # "CL" light sweet crude
   # "HU" gasoline
   # "HO" heating oil
   # "NG" henry hub natural gas
   # "PA" palladium
   # "PL" platinum
   # "PN" propane
   # "QG" e-miNY henry hub natural gas
   # "QL" CAPP central appalacian coal
   # "QM" e-miNY light sweet crude
   # "SC" brent crude - dublin
   #
   # "GR" north west gasoil - dublin
   # "SA" brent calendar swap futures - clearport new york
   #
   # don't know what barchart "F0" heating oil / crude and "F5"
   # unleaded / crude are really
  );

# (set! barchart-suffix-delay-alist (cons* '(".CMX" . 30)
# 					 '(".NYM" . 30)
# 					 barchart-suffix-delay-alist))


# This was some bits to make the timezone come out as London (and
# previously Dublin) for some relevant symbols.  But www.nymex.com doesn't
# make it clear (as of March 2007) what's where, so leave it all as New
# York for now.

# NYMEX symbols trading in London
#
# http://www.nymex.com/press_releas.aspx?id=pr20050825c
#     Aug 05 press release - brent crude + northwest gasoil
#
# (define (nymex-london-symbol? symbol)
#   (and (nymex-symbol? symbol)
#        (member (chart-symbol-commodity symbol)
# 	       '("GR"  # gasoil
# 		 "BB"  # brent crude
# 		 ))))
# (symbol-timezone! nymex-london-symbol?  (_ "London")    timezone-london)

# Contracts trading open-outcry in London (currently Brent Crude @samp{SC} and
# Northwest Europe Gasoil @samp{GR}) have that as their home timezone for the
# watchlist etc, everything else is New York.
# @c xSYMBOL: SC.NYM
# @c xSYMBOL: GR.NYM




1;
__END__



( run in 2.969 seconds using v1.01-cache-2.11-cpan-39bf76dae61 )