[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GT] SVN Commit r655 - in trunk/GT: . BackTest Indicators



Author: joao
Date: 2008-07-30 11:05:30 +0200 (Wed, 30 Jul 2008)
New Revision: 655

Modified:
   trunk/GT/BackTest/Spool.pm
   trunk/GT/Calculator.pm
   trunk/GT/Indicators/EVWMA.pm
   trunk/GT/Prices.pm
Log:
Remove dependency on libxml when it is not being used

http://www.geniustrader.org/lists/devel/msg02721.html



Modified: trunk/GT/BackTest/Spool.pm
===================================================================
--- trunk/GT/BackTest/Spool.pm	2008-07-27 17:30:44 UTC (rev 654)
+++ trunk/GT/BackTest/Spool.pm	2008-07-30 09:05:30 UTC (rev 655)
@@ -10,6 +10,7 @@
 use vars qw(@ISA);
 
 use GT::Tools qw(:conf);
+use GT::Serializable;
 #ALL# use Log::Log4perl qw(:easy);
 
 @ISA = qw(GT::Serializable);

Modified: trunk/GT/Calculator.pm
===================================================================
--- trunk/GT/Calculator.pm	2008-07-27 17:30:44 UTC (rev 654)
+++ trunk/GT/Calculator.pm	2008-07-30 09:05:30 UTC (rev 655)
@@ -5,7 +5,6 @@
 # version 2 or (at your option) any later version.
 
 use GT::CacheValues;
-use GT::MetaInfo;
 
 =head1 NAME
 
@@ -14,7 +13,7 @@
 =head1 DESCRIPTION
 
 This is a facility object to ease the collaboration between GT::Prices
-and GT::CacheValues and GT::MetaInfo. It contains the prices (GT::Prices),
+and GT::CacheValues. It contains the prices (GT::Prices),
 and the result of various indicators and signals within two GT::CacheValues
 object. This object is manipulated by all the indicators, signals and
 systems.
@@ -46,10 +45,6 @@
 Return the corresponding object of the indicated timeframe. Learn
 more about the timeframes in GT::DateTime.
 
-=item C<< $c->metainfo() >>
-
-Returns the metainfo object associated to the share.
-
 =item C<< $c->set_code($code) >>
 
 Sets the code of the share which datas are stored in this object.
@@ -71,8 +66,6 @@
     $self->{'tf'}{$prices->timeframe}{'indics'} = GT::CacheValues->new;
     $self->{'tf'}{$prices->timeframe}{'signals'} = GT::CacheValues->new;
     
-    $self->{'_metainfo'} = GT::MetaInfo->new();
-    
     bless $self, $class;
     
     $self->set_current_timeframe($prices->timeframe);
@@ -91,8 +84,6 @@
 sub indicators { $_[0]->{'_indics'}  }
 sub signals    { $_[0]->{'_signals'} }
 
-sub metainfo   { $_[0]->{'_metainfo'} }
-
 sub prices_on_timeframe     { $_[0]->{'tf'}{$_[1]}{'prices'} }
 sub indicators_on_timeframe { $_[0]->{'tf'}{$_[1]}{'indics'} }
 sub signals_on_timeframe    { $_[0]->{'tf'}{$_[1]}{'signals'} }

Modified: trunk/GT/Indicators/EVWMA.pm
===================================================================
--- trunk/GT/Indicators/EVWMA.pm	2008-07-27 17:30:44 UTC (rev 654)
+++ trunk/GT/Indicators/EVWMA.pm	2008-07-30 09:05:30 UTC (rev 655)
@@ -16,6 +16,7 @@
 
 use GT::Indicators;
 use GT::Prices;
+use GT::MetaInfo;
 
 @ISA = qw(GT::Indicators);
 @NAMES = ("EVWMA");
@@ -69,6 +70,12 @@
 =head2 GT::Indicators::EVWMA::calculate($calc, $day)
 
 =cut
+sub initialize {
+    my ($self) = @_;
+
+    $self->{'metainfo'} = GT::MetaInfo->new();
+}
+
 sub calculate {
     my ($self, $calc, $i) = @_;
     my $getvalue = $self->{'_func'};
@@ -84,8 +91,8 @@
     return if not (-e "/bourse/metainfo/" . $calc->code . ".xml");
        
     # Find the number of floating shares
-    $calc->metainfo->load("/bourse/metainfo/" . $calc->code . ".xml");
-    my $floating_shares = $calc->metainfo->get("floating_shares");
+    $self->{'metainfo'}->load("/bourse/metainfo/" . $calc->code . ".xml");
+    my $floating_shares = $self->{'metainfo'}->get("floating_shares");
     
     for (my $n = 0; $n <= $i; $n++) {
     

Modified: trunk/GT/Prices.pm
===================================================================
--- trunk/GT/Prices.pm	2008-07-27 17:30:44 UTC (rev 654)
+++ trunk/GT/Prices.pm	2008-07-30 09:05:30 UTC (rev 655)
@@ -10,10 +10,9 @@
 use Date::Calc qw(Decode_Date_US Decode_Date_EU Today);
 #ALL#  use Log::Log4perl qw(:easy);
 use GT::DateTime;
-use GT::Serializable;
 
 require Exporter;
-
AT
ISA = qw(Exporter GT::Serializable);
+
AT
ISA = qw(Exporter);
 @EXPORT = qw($FIRST $OPEN $HIGH $LOW $LAST $CLOSE $VOLUME $DATE);
 
 $FIRST = $OPEN = 0;
@@ -105,6 +104,9 @@
 sub add_prices_array {
     my ($self, @prices) = @_;
     push @{$self->{'prices'}}, @prices;
+    use Data::Dumper;
+    print Dumper(\$self);
+    exit;
 }
 
 =item C<< $p->add_prices([$open, $high, $low, $close, $volume, $date]) >>