[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GT] Re: Re: EMA incorrect when using --nb-item
- To: devel
AT
geniustrader.org
- Subject: [GT] Re: Re: EMA incorrect when using --nb-item
- From: Nick Fantes Huege <nfhuege
AT
gmail.com>
- Date: Wed, 21 Jul 2010 23:29:00 +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=9yX8e545L8fFFNKsjvx1NWv+CbPqQyObkakW6oIw/hc=; b=eT8ct0QSEgqWuKVoiIGoOZ1MMUdRafsCDFxJ7JTuK9B8W3t4O/GZroYghpQIoj9HXS W1q1NEhuGYGFiVStZ1DBYg8QZe248qYvAXiFlAT5ByZdEse92RvxhaIRF/AlV7pJxCFW /VXqxT3x7E32FIUFQkHP6NeFB8pXUXfep3CnA=
- 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=DhXL69HwgFLDCrbAJ4hGWJmFZAoQGucmYjHWt7EctPW7jbe9YZYakfv4sIENPqxVas 7wSLIVSjzVf9L8jMeiGyTd14rAncIVe/RiO/ypeO87+xldK8exFWAf5lKcBqdXHNyvhl zV9jTP6LavGLwoDwJfHien5FZ0su5r+u6411k=
- In-reply-to: <4C471D95.4070508
AT
acm.org>
- Message-id: <AANLkTim7vphoCIKF4ku37jNXVZzj7UE9O_2k_7F_HLEB@mail.gmail.com> (sfid-20100721_223048_027272_41A6DA7D)
- Reply-to: devel
AT
geniustrader.org
Hello Ras,
Thank you for your answer! Allow me to respectfully disagree with you
about the use of --nb-items. It seems that its purpose was to limit
the number of results displayed, not computed.
In Scripts/display_indicator.pl we see the following code:
if ($last_record) {
$full = 0;
$start = '';
$end = '';
$nb_item = 1;
}
$last_record is set if we pass the option --last-record.
In other words, if we want to see only the last record (for example
the EMA for today) we add --last-record, which sets $nb_item to 1.
The above code contradicts with the code in Tools::find_calculator
where $nb_item clearly trumps $full, but yields to $start and $end,
and so participates in the computing of the indicator. To my opinion
this should be fixed, and I don't mind doing it if we agree to it.
If I'd like to see today's EMA(200) for YHOO, I could use this:
./display_indicator.pl --last-record I:EMA YHOO 200
completely equal to:
./display_indicator.pl --nb-item=1 I:EMA YHOO 200
How is a 200 day moving average going to get computed if we only have
one day available?
You ask:
> i'm not sure why you would want to use --nb-item=10 and also use a 60
> bar time period ema?
The example was supposed to display the last 10 values of a 60 day
EMA, the same way this chart does:
http://stockcharts.com/h-sc/ui?s=YHOO&p=D&yr=0&mn=0&dy=10&id=p58199359097
I still think that &calculate_interval in EMA.pm must be fixed to set
--full=1 (or $first = 0) in order to present as accurate moving
average value as possible. Otherwise any signals that use --nb-item
are going to be misleading.
Regards,
Nick