lee_ready_vec: Applies the Lee & Ready (1991) algorithm

Description Usage Arguments Details Value References

View source: R/functions.R

Description

Applies the Lee & Ready (1991) algorithm

Usage

1
lee_ready_vec(price, bid_price, ask_price)

Arguments

price

a numeric vector containing the transaction price series.

bid_price

a numeric vector containing the bid price series.

ask_price

a numeric vector containing the ask price series.

Details

This function applies the algorithm by Lee & Ready (1991) to infer trade direction from prices. The function runs fast C++-code in the background using the Rcpp functionality. Note that the length of all input vectors have to be the same, otherwise the C++-code throws an exception.

Value

an integer vector containing the trade direction with a buy indicated as 1 and a sell indicated as -1

References

Lee and Ready (1991), "Inferring Trade Direction from Intraday Data," Journal of Finance, Vol. 42, Issue 2


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