remove_jumps: Remove overnight close-to-open price jumps from an _OHLC_...

View source: R/HighFreq.R

remove_jumpsR Documentation

Remove overnight close-to-open price jumps from an OHLC time series, by adding adjustment terms to its prices.

Description

Remove overnight close-to-open price jumps from an OHLC time series, by adding adjustment terms to its prices.

Usage

remove_jumps(ohlc)

Arguments

ohlc

An OHLC time series of prices and trading volumes, in xts format.

Details

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.

Value

An OHLC time series with the same dimensions and the same time index as the input ohlc time series.

Examples

# Remove overnight close-to-open price jumps from SPY data
ohlc <- remove_jumps(HighFreq::SPY)


algoquant/HighFreq documentation built on Feb. 9, 2024, 8:15 p.m.