Description Usage Arguments Value Examples
Get events for percentage change
1 | GetPercentageChangeEvents(x, percentChange = -0.03)
|
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). |
Logical vector where TRUE is the row that the event occured.
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.