[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [GT] logarithmic values and scale.pm
"robert a. schmied" wrote:
>
> aloha Oliver
>
> Oliver Bossert wrote:
> >
> > Hi ras,
> >
> > >i'm thinking it is caused by either plotting RSI or SMA curves on a log price
> > >plot.
>
> after more closely looking at the graphic.conf file i wish to restate the above:
> i'm thinking it is caused by plotting either SMA or BOL curves on a log price
> plot
>
> >
> > When you plot the SMA the value should never be nevative as the SMA is calculated on the price and a negative price is not possible.
>
> i agree. however, i suspect the situation was one of the boundary areas where
> i was trying to access price data outside the range of the database and the
> SMA calculation was generating garbage.
>
> the problem went away when i moved the graph start well past the beginning of
> data. upon review however the database starts at 1998-12-28 and the failing
> graphic.pl had a start of 2001-12-31 with a default end of 120 periods, so now
> i'm not sure where the problem is coming from. (note this has occurred with a
> number (3-6) of my securities, with the same graphic config file. there are
> 3 sma curves, 200, 38 and 13 in the plot, plus a votingline that is using
> a BBO indicator (that shouldn't be subject to graph scaling?)
>
> fyi -- one of the motivations for reporting this was my feeble attempt to
> point out the apparent weaknesses of the data validation testing built into
> the gt code. if i understood better how the modules are coded and operate
> and how to debug oo-perl i'd be willing to help with corrective patches, but
> at the moment i'm just a hacker poking at the code and watching it fail.
>
> >
> > When plotting the RSI a logarithmic scale is normally not necessary because you use the log-scale to normalize the price-movement; but the RSI is already normalized by its formula so that it is between 0 and 100.
>
> interesting -- this might be a place to point out that documentation
> of indicators should include the output value range (max limits) as well
> as the default conditions and values if applicable. now watch that the RSI
> docs to do just that!
>
> >
> > Maybe you can isolate a single case where your negaitve number occurs. We can then look if it is a bug in the indicator or if the indicator is right but the number produces should not be displayed on a logarithmic chart...
>
> i can reproduce these occurrences with my real world data, but have yet to
> attempt it with the test data set. if time permits ...
>
> >
> > CU, Olf
here is a text based data set that demonstrates the problem. it now appears
that there are no indicators at fault!?
the files included:
./sample_data/mmm.txt # 2 months of 3M corp between 1sep2002 and 1nov2002
./Scripts/sys_2x.gconf # minimal log scaled plot
./options # minimal ~/.gt/options file
note that my graphic.pl has been altered from that of the mainstream,
and isn't even that current. the command version is (ls -l):
-rwxr-xr-x 1 ras 1000 22243 Jun 8 2003 graphic.pl.orig
with md5sum = f7fd7b21b1560e79e9ab13db9c7c2de2
from the tarball on 25dec2003.
the command and output:
% graphic.pl.orig -f=sys_2x.gconf mmm > ! graphs/mmm.png
Can't take log of -1.58 at ../GT/Graphics/Scale.pm line 117.