nocb_1min_vec: Calculates the 1-minute price lead

Description Usage Arguments Details Value See Also

View source: R/functions.R

Description

Calculates the 1-minute price lead

Usage

1
nocb_1min_vec(price, time_stamp)

Arguments

price

a numeric vector containing the price series.

tradetime

a POSIXct vector containing the time stamps of the price series.

Details

This function calculates the 1-minute lead price corresponding to each of the entries in price. The return value has the same length as the input vector to ensure compatibility inside of e.g. a data.frame.

The POSIXct datetime format is a requirement as this function runs fast C++-code in the background that expects a double format which is provided by the POSIXct format (see herefore the Rcpp::Datetime).

For matching an NOCB (next observation carried backwards) approach is used, i.e. if for a price with certain timestamp there exists 1-minute price lead, the next >1-minute price lead is used. This leads possibly to repeating price lead entries. Furthermore, as the length of the return vector is the same as the input vector, the last entries of the return vector are usually NA values.

If a timestamp is required for reasons of documentation or testing it is referred to the data.frame-equivalent nocb_1min_df, which returns next to the 1-minute lead price series in addition the 1-minute lead timestamp.

Value

a numeric vector containing the 1-minute price lead.

See Also

nocb_1min_df, nocb_5min_vec, nocb_5min_df


simonsays1980/tim documentation built on July 19, 2019, 7:35 a.m.