[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GT] Trouble with backtest.pl and beancounter
- To: devel
AT
geniustrader.org
- Subject: [GT] Trouble with backtest.pl and beancounter
- From: "Nicholas Kuechler" <nkuechler
AT
gmail.com>
- Date: Tue, 29 Apr 2008 11:58:19 -0500
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:mime-version:content-type; bh=uz37+EskBug6WhAZw7RqYVEiPMfYAtQA1tIBo6c711o=; b=mrGqtkfJlYxZ9niepiAluf1Jv/CMZL41lcWCLwEhNwZCYl5GnMxkM/YQPYxfs043NKflTQjdztBU7bawzzsr6tuKw5/gspme7UT7K2AAcwRMP/s2AlP09lBmaRRD/EJu/RSuxn97iMh4zfWsDXiz8QBesQ87bj5P+u9+AvadGaA=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:mime-version:content-type; b=FVgVJsz2x64tkwRQ15QyTbZFSil0e/UwzeB534D6MjC6WgIP4dvxLrTSl936gup3lGcjL+X45OCrkRRNRdvRHul8fzNLPmD7VgKXkWgPgfce+QNv2DAueoFTAWESWcysxgEL6KTlq1LgxWQAhNEksJn6gV0XKFL8ptn/qemys/4=
- Message-id: <95bdc7d80804290958l66c29d54n3d8bc68d1c229d0d@mail.gmail.com>
- Reply-to: devel
AT
geniustrader.org
Hi,
I'm running in to some trouble with the backtest.pl and beancounter DB module. This is my first time in a very long time using backtest.pl.
Here's what I'm doing:
$ time ./backtest.pl --output-directory /opt/GeniusTrader/backtest "Systems:ADX 30 | TradeFilters:FollowTrend | MoneyManagement:Basic" GOOG
## Analysis of SY:ADX 30|TF:FollowTrend 50|MM:Basic|MM:Basic
History of the portfolio :
--------------------------
DBD::mysql::st execute failed: MySQL server has gone away at ../GT/DB/bean.pm line 161.
MySQL server has gone away at ../GT/DB/bean.pm line 161.
Long position
real 0m29.489s
user 0m28.410s
sys 0m0.090s
The times at the bottom are for debugging.
Initially I thought the beancounter query was taking a very long time to execute, so I set the wait_timeout in my.cnf to 180 seconds and restarted my mysql server. So it would appear mysql server is not the issue, since backtest.pl is failing in only 29 seconds.
The chunk of code this fails at:
sub get_db_name {
my ($self, $code) = @_;
my $sql = "SELECT name FROM stockinfo WHERE symbol = '$code'";
my $sth = $self->{'_dbh'}->prepare($sql) || die $self->{'_dbh'}->errstr;
$sth->execute() || die $self->{'_dbh'}->errstr;
my $res = $sth->fetchrow_arrayref;
return $res->[0];
}
Which seems pretty straight forward. It just wants to grab the company name of the ticker I'm backtesting.
Anyone run in to this problem before? Or can suggest a fix?
Thanks!
Nick
--
Nicholas Kuechler