remove_jumps | R Documentation |
Remove overnight close-to-open price jumps from an OHLC time series, by adding adjustment terms to its prices.
remove_jumps(ohlc)
ohlc |
An OHLC time series of prices and trading volumes, in xts format. |
The function remove_jumps()
removes the overnight
close-to-open price jumps from an OHLC time series, by adjusting its
prices so that the first Open price of the day is equal to the last
Close price of the previous day.
The function remove_jumps()
adds adjustment terms to all the
OHLC prices, so that intra-day returns and volatilities are not
affected.
The function remove_jumps()
identifies overnight periods as those
that are greater than 60 seconds. This assumes that intra-day periods
between neighboring rows of data are 60 seconds or less.
The time index of the ohlc
time series is assumed to be in
POSIXct format, so that its internal value is equal to the number of
seconds that have elapsed since the epoch.
An OHLC time series with the same dimensions and the same time
index as the input ohlc
time series.
# Remove overnight close-to-open price jumps from SPY data
ohlc <- remove_jumps(HighFreq::SPY)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.