[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GT] Re: Re: Re: EMA incorrect when using --nb-item
Nick,
--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.
After the data is loaded (see Tools::find_calculator), the analysis
range is determined. This is done based on --nb-item, --start, --end,
and --full. The pod, I believe, captures what the code says.
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.
On 07/22/2010 04:01 PM, Nick Fantes Huege wrote:
> Why would anyone want to use both --max-loaded-items and --nb-item?
> The first one already intelligently limits the data pulled from the
> database, and the second one further creates a subset from the already
> limited data. This results in displaying wrong data in the example
> when calculating EMA.
>
These two variables are totally different. The first is an optimization
for data loading. The second controls what you are actually doing.
It does not "create a subset from the already limited data".
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.
> Just to clarify something:
>
>
>> ./display_indicator.pl --nb-item=1 I:EMA YHOO 200
>>
>> is wrong, because the --nb-item=1 will eliminate most input data,
>> but the command
>>
>> ./display_indicator.pl --last-record I:EMA YHOO 200
>>
>> is correct, because it correctly uses the default analysis range,
>> but only outputs the last record.
>>
> 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.
Th.