forked from joshuaulrich/TTR
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathZigZag.Rd
68 lines (61 loc) · 2.13 KB
/
ZigZag.Rd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/ZigZag.R
\name{ZigZag}
\alias{ZigZag}
\alias{zigzag}
\title{Zig Zag}
\usage{
ZigZag(HL, change = 10, percent = TRUE, retrace = FALSE,
lastExtreme = TRUE)
}
\arguments{
\item{HL}{Object that is coercible to xts or matrix and contains either a
High-Low price series, or a Close price series.}
\item{change}{Minimum price movement, either in dollars or percent (see
\code{percent}).}
\item{percent}{Use percentage or dollar change?}
\item{retrace}{Is \code{change} a retracement of the previous move, or an
absolute change from peak to trough?}
\item{lastExtreme}{If the extreme price is the same over multiple periods,
should the extreme price be the first or last observation?}
}
\value{
A object of the same class as \code{HL} or a vector (if
\code{try.xts} fails) containing the Zig Zag indicator.
}
\description{
Zig Zag higlights trends by removing price changes smaller than \code{change}
and interpolating lines between the extreme points.
}
\details{
The Zig Zag is non-predictive. The purpose of the Zig Zag is filter noise
and make chart patterns clearer. It's more a visual tool than an indicator.
}
\note{
If High-Low prices are given, the function calculates the max/min using
the high/low prices. Otherwise the function calculates the max/min of the
single series.
}
\section{Warning}{
The last value of the ZigZag indicator is unstable (i.e.
unknown) until the turning point actually occurs. Therefore this indicator
isn't well-suited for use for systematic trading strategies.
}
\examples{
## Get Data and Indicator ##
data(ttrc)
zz <- ZigZag( ttrc[,c("High", "Low")], change=20 )
}
\references{
The following site(s) were used to code/document this
indicator:\cr
\url{http://www.fmlabs.com/reference/default.htm?url=ZigZag.htm}\cr
\url{https://www.linnsoft.com/techind/zig-zag-indicator-zig-zzo}\cr
\url{https://www.linnsoft.com/techind/zig-zag-oscillator-indicator-zzo}\cr
\url{http://www.metastock.com/Customer/Resources/TAAZ/#127}\cr
\url{http://www.stockcharts.com/school/doku.php?id=chart_school:technical_indicators:zigzag}\cr
}
\author{
Joshua Ulrich
}
\keyword{ts}