[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GT] Re: Re: Re: Re: EMA incorrect when using --nb-item
- To: devel
AT
geniustrader.org
- Subject: [GT] Re: Re: Re: Re: EMA incorrect when using --nb-item
- From: Nick Fantes Huege <nfhuege
AT
gmail.com>
- Date: Thu, 22 Jul 2010 19:55:21 +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=o83+VwMbcZssg0VdFe+/pK5owDmNRdt02oioLZX29lc=; b=DIn9wRjQJYnzTEtsIm/2LBGRVgBt+PAgE695BxevG/KdmWcIkeuxYPUZndhiq+ah2K FDzR3QdiaX6uLrtzHbXqZYzx4iDhgFq0O3L2w0Sqpx0aig+wzsvCW56BS+KVobX1cSXo +xHBJOXL3U5dAKdUncnqvy8MU5b/qn3RVs7Pg=
- 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=GBH98wXudEtlWE+m9nBW7SmetVrelbI0WLu2sZQo59CjT96uCw2LuTcqslwwa2eSBa fzgeWxNglZse8VKtwlg3U1OQ0xZMav1u0SxP0jw5xvyzLLWvcWerpwvL+nLnJfJx4DlG UYN+f0siUSg+lyPgrNL5fsz37m1HLDLKGcZRo=
- In-reply-to: <4C486BFB.7080307
AT
mst.edu>
- Message-id: <AANLkTineHswZALK6zntCjEKpDWpXpX2QAsUEu1zMHhlT@mail.gmail.com> (sfid-20100722_185636_879513_101117C1)
- Reply-to: devel
AT
geniustrader.org
Thomas,
Thank you for your reply!
I am beginning to think that we are looking at different versions of GT.
> --max-loaded-items is an optimization to avoid loading records from the
> data base that are not needed for analysis. It has no impact on analysis
> other than these records will not be available. Note that you have to be
> careful in using it, as the analysis might need more data than one
> thinks, due to dependencies of indicators, for example. It has no effect
> for text data.
It seems that for the dependencies of indicators GT automatically
changes max-loaded-items to -1, ignoring the user defined value. This
way it grabs all of the available data. Note that I'm testing with
DB::module=genericdbi, using SQLite.
> When you use these parameters in a script, they apply to the base
> market. They do NOT dictate how much other data is considered. For
> example, a 200 day indicator will load much more data, even if you say
> you just want the last 10 days of analysis.
I disagree. The following line:
./display_indicator.pl --nb-item=1 I:EMA YHOO 200
considers in its calculations only one data item. I tested, retested
and finally traced it with the Perl debugger. It bases all
calculations on the last day price of YHOO.
I still think that at the very least this should print a warning.
> Regarding EMA, you have to be careful. Technically, EMA needs data from
> the first day of the market, as it goes back indefinitely. Most
> implementations of EMA limit the data and just use SMA for the first
> data point that they are looking at. You can control this in gt by
> giving a third parameter to EMA.
Can you give me an example of using the third parameter?
>> Both commands are absolutely equal because --last-record is a
>> synonymous for --nb-item=1
>
> This is correct. --last-record is just a shortcut to get the last data
> item only. It does NOT mean that we only compute the EMA based on 1 day.
It DOES mean that we compute EMA based on only 1 day.
Here is what --last-record does:
if ($last_record) {
$full = 0;
$start = '';
$end = '';
$nb_item = 1;
}
Best regards,
Nick