[R-SIG-Finance] the ZigZag function

Joshua Ulrich josh.m.ulrich at gmail.com
Wed Apr 25 15:40:11 CEST 2012


On Wed, Apr 25, 2012 at 6:45 AM, Gordon Erlebacher
<gordon.erlebach at gmail.com> wrote:
> Hi,
>
> I am using the ZigZag function (which is more elegant than the one I
> wrote), and wish to only get the extrema, not the linearly interpolated
> lines. In the function, I'd like to remove the line:
>
>       zz <- approx(zz, xout = 1:nn)$y
>
> Is this possible? If yes, how? I tried copying the function and using mine,
> but then I get errors such as naCheck not defined,
> which is surely an environment issue.
>
Technically, it's a namespace issue.  Use TTR:::naCheck to access the
function in your copy.  You also might be able to use findPeaks and
findValleys from quantmod to find the points you want, rather than
creating another function.

>  Thanks,
>
>     Gordon
>

Best,
--
Joshua Ulrich  |  FOSS Trading: www.fosstrading.com

R/Finance 2012: Applied Finance with R
www.RinFinance.com



More information about the R-SIG-Finance mailing list