GetPercentageChangeEvents: Get events for percentage change

Description Usage Arguments Value Examples

Description

Get events for percentage change

Usage

1
GetPercentageChangeEvents(x, percentChange = -0.03)

Arguments

x

A single column xts or matrix series with numeric values.

percentChange

Percent change expressed as a decimal (if the value is greater than 1 or less than -1, then the value is converted to decimal format).

Value

Logical vector where TRUE is the row that the event occured.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
## Not run: 
data(YHOO)
#Get the events that have a 5% drop
GetPercentageChangeEvents(Ad(YHOO), -0.05)
GetPercentageChangeEvents(Ad(YHOO), -5)

# Get the number of times YHOO dropped 3% in price
sum(GetPercentageChangeEvents(Ad(YHOO)))

# Get the number of times YHOO increased by 3% in price by day
sum(GetPercentageChangeEvents(Ad(YHOO), 3))

## End(Not run)

justinnafe/TechnicalEvents documentation built on May 20, 2019, 5:16 a.m.