[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GT] SVN Commit r616 - trunk/Scripts
Author: thomas
Date: 2008-04-22 03:05:45 +0200 (Tue, 22 Apr 2008)
New Revision: 616
Modified:
trunk/Scripts/backtest.pl
trunk/Scripts/backtest_many.pl
trunk/Scripts/backtest_multi.pl
trunk/Scripts/display_indicator.pl
trunk/Scripts/display_signal.pl
trunk/Scripts/graphic.pl
trunk/Scripts/scan.pl
Log:
Support date checking and automatic conversion to correct timeframe format in all scripts.
Modified: trunk/Scripts/backtest.pl
===================================================================
--- trunk/Scripts/backtest.pl 2008-04-20 23:18:25 UTC (rev 615)
+++ trunk/Scripts/backtest.pl 2008-04-22 01:05:45 UTC (rev 616)
@@ -333,6 +333,9 @@
$timeframe = GT::DateTime::name_to_timeframe($timeframe);
+# Verify dates and adjust to timeframe, comment out if not desired
+check_dates($timeframe, $start, $end);
+
my ($calc, $first, $last) = find_calculator($code, $timeframe, $full, $start, $end, $nb_item, $max_loaded_items);
# The real work happens here
Modified: trunk/Scripts/backtest_many.pl
===================================================================
--- trunk/Scripts/backtest_many.pl 2008-04-20 23:18:25 UTC (rev 615)
+++ trunk/Scripts/backtest_many.pl 2008-04-22 01:05:45 UTC (rev 616)
@@ -189,6 +189,9 @@
die "The directory '$outputdir' doesn't exist !\n";
}
+# Verify dates and adjust to timeframe, comment out if not desired
+check_dates($timeframe, $start, $end);
+
# Create all the framework
my $list = GT::List->new;
my $file = shift;
Modified: trunk/Scripts/backtest_multi.pl
===================================================================
--- trunk/Scripts/backtest_multi.pl 2008-04-20 23:18:25 UTC (rev 615)
+++ trunk/Scripts/backtest_multi.pl 2008-04-22 01:05:45 UTC (rev 616)
@@ -185,6 +185,9 @@
die "The directory $outputdir does not exist!\n";
}
+# Verify dates and adjust to timeframe, comment out if not desired
+check_dates($timeframe, $start, $end);
+
# Create all the framework
my $list = GT::List->new;
my $file = shift;
Modified: trunk/Scripts/display_indicator.pl
===================================================================
--- trunk/Scripts/display_indicator.pl 2008-04-20 23:18:25 UTC (rev 615)
+++ trunk/Scripts/display_indicator.pl 2008-04-22 01:05:45 UTC (rev 616)
@@ -142,6 +142,10 @@
$end = '';
$nb_item = 1;
}
+
+# Verify dates and adjust to timeframe, comment out if not desired
+check_dates($timeframe, $start, $end);
+
# Create the indicator according to the arguments
my $indicator_module = shift || pod2usage(verbose => 2);
my $code = shift || pod2usage(verbose => 2);
Modified: trunk/Scripts/display_signal.pl
===================================================================
--- trunk/Scripts/display_signal.pl 2008-04-20 23:18:25 UTC (rev 615)
+++ trunk/Scripts/display_signal.pl 2008-04-22 01:05:45 UTC (rev 616)
@@ -175,6 +175,9 @@
$nb_item = 1;
}
+# Verify dates and adjust to timeframe, comment out if not desired
+check_dates($timeframe, $start, $end);
+
# Create the signal according to the arguments
my $signal_module = shift || pod2usage(verbose => 1);
my $code = shift || pod2usage(verbose => 1);
Modified: trunk/Scripts/graphic.pl
===================================================================
--- trunk/Scripts/graphic.pl 2008-04-20 23:18:25 UTC (rev 615)
+++ trunk/Scripts/graphic.pl 2008-04-22 01:05:45 UTC (rev 616)
@@ -342,15 +342,18 @@
"option=s" => \
AT
options, "title=s" => \$title,
"file=s" => \$filename, "driver=s" => \$opt_driver,
"man!" => \$man);
+$timeframe = GT::DateTime::name_to_timeframe($timeframe);
foreach (@options) {
my ($key, $value) = split (/=/, $_);
GT::Conf::set($key, $value);
}
+# Verify dates and adjust to timeframe, comment out if not desired
+check_dates($timeframe, $start, $end);
+
pod2usage( -verbose => 2) if ($man);
my $code = shift || pod2usage(1);
-$timeframe = GT::DateTime::name_to_timeframe($timeframe);
my ($calc, $first, $last) = find_calculator($code, $timeframe, $full, $start, $end, $nb_item, $max_loaded_items);
$nb_item = $last - $first + 1;
Modified: trunk/Scripts/scan.pl
===================================================================
--- trunk/Scripts/scan.pl 2008-04-20 23:18:25 UTC (rev 615)
+++ trunk/Scripts/scan.pl 2008-04-22 01:05:45 UTC (rev 616)
@@ -24,9 +24,6 @@
use Getopt::Long;
use Pod::Usage;
-use Date::Calc qw( Date_to_Days );
-#use Date::Manip;
-
GT::Conf::load();
( my $prog_name = $0 ) =~ s
AT
^.*/@@; # lets identify ourself
@@ -241,7 +238,7 @@
# get date string from command line
my $date = shift;
-# comment out if not desired
+# Verify dates and adjust to timeframe, comment out if not desired
check_dates($timeframe, $start, $end, $date);
# Build the list of systems to test