[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GT] Re: Re: Proposed patch for Indicators::new()
- To: devel
AT
geniustrader.org
- Subject: [GT] Re: Re: Proposed patch for Indicators::new()
- From: Nick Fantes Huege <nfhuege
AT
gmail.com>
- Date: Thu, 22 Jul 2010 22:18:02 +0300
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:content-type; bh=PyIyjoURhidZVGzONeBjjoO47LgHF/6t+PRyB5AuLkc=; b=b14wUzhtzfrjaVo28vk0A5T6hamewpHAROAeR8/pt/vk4/x0+hs1T8eeo1cnKh9D4x 2zJoE66Y4l3GIPNqk8G/U6DIDape4VFoWnn+4ZPIsmAA2k8w65VJD+txPYGhhKrTqTVt bD90j3RGxZ2UxJG/EkTg3zkQwnco4zNs8cPc8=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=IIGM/Ga4a4Hy7IsmKs8aGn+gzszFYd9DKUMe/jNxTQLAxvSuSUGLuXXgm56Girl/mH gzHpckFoDIKi4w66lgH0gJqfvrle1xN6XdHndU+BaTuXvlZ6wtVp98bYTvj5HJ7aPYN1 qrtKgamfEOzeNLJoRx2muaK7xHWbYfdtrRlbI=
- In-reply-to: <4C4881FB.4020008
AT
acm.org>
- Message-id: <AANLkTinPjho5MAqjYSEbSCGSTxhKkfBpUnRHOT7onCco@mail.gmail.com> (sfid-20100722_211917_281820_15082E32)
- Reply-to: devel
AT
geniustrader.org
I've been keeping an eye on GT for a while, but just recently got
really involved in it. The reason I started analyzing the Perl code
was because I couldn't find any real documentation on how to use the
system. So I started reading the code.
> i will evaluate your changes, however, you will find similar code in most
> of the other 'new()' methods for all data objects implemented by gt.
> GT::Analyzers
> GT::CloseStrategy
> ...
I haven't gotten to those yet, but it seems like they are all using
99% for the same code, at least for the constructor of the object. The
Object Oriented approach to this would be to write the common code in
a parent class once and then inherit it where needed. Should be an
easy fix ...
> so if we really want to make this change (i'm not against it, i have gotten
> more than one headache staring at those 'new()' method code blocks than i
> care to remember), but to do the right thing we really should fix all of
> them at the same time.
What these code blocks do is:
1. Check for the passed arguments
2. Find if the number of arguments is sufficient and if not add from a
predefined list of default arguments.
For example:
./display_indicator.pl I:SMA YHOO 40
silently adds a second argument of {I:Prices CLOSE}
This is neat, because one can explicitly add the second argument, for example:
./display_indicator.pl I:SMA YHOO 21 {I:RSI 14}
This will give you the 21 day moving average of the RSI(14) for Yahoo.
> how much evaluation testing have you conducted (and how) to show this change
> is equivalent?
I tested with all display_*.pl files and I get the same results as the
previous code, which doesn't really surprise me because anyway you
look at it both codes do the exact same thing. The one I propose is
just a little shorter and more compatible.
> as far as versions go -- i will try to always refer to the gt trunk version
> not the cpan or exp branches.
I saw GT on cpan, but I didn't think it was a good idea. At least I
don't see the reason for it.
I'm using git to keep track of my modifications, and I also work on
the GT trunk version.
Best regards,
Nick