to_period | R Documentation |
Given an xts time series at high periodicity (say seconds), calculate the OHLC prices at a lower periodicity (say minutes).
to_period(timeser, period = "minutes", k = 1)
timeser |
An xts time series of prices. |
period |
Aggregation interval ("seconds", "minutes", "hours", "days", "weeks", "months", "quarters", and "years"). |
k |
The number of periods to aggregate over (for example if
|
The function to_period()
is a wrapper for the function
xts::to.period()
from package
xts.
A OHLC time series of prices in xts format, with a lower periodicity.
## Not run:
# Aggregate the OHLC prices from minutes to days:
ohlc <- rutils::to_period(timeser=HighFreq::SPY["2009"], period="days")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.