Description Usage Arguments Details Value See Also
Calculates the 1-minute price lead
1 | nocb_1min_vec(price, time_stamp)
|
price |
a numeric vector containing the price series. |
tradetime |
a POSIXct vector containing the time stamps of the price series. |
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.
a numeric vector containing the 1-minute price lead.
nocb_1min_df
, nocb_5min_vec
, nocb_5min_df
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.