price_impact: Compute price impact

Description Usage Arguments Details

View source: R/functions.R

Description

price_impact calculates the price impact for a certain lead x.

Usage

1
price_impact(indicator, price, price_lead)

Arguments

indicator

an integer vector or numeric vector for t.

price

a numeric vector holding the prices for t.

price_lead

a numeric vector holding the leading prices for t+x.

Details

This function takes intraday data from a financial exchange and calculates the price impact defined PI = \frac{1}{T}∑_{t=1}^Tq_t(m_{t+x}-m_t) , where q_t is the price indicator at time t , m_t is the midquote at time t and x is a certain time interval, e.g. 1 or 5 minutes. So, the indicator time always corresponds to the starting midquote m_t . All price impacts are calculated in US $-Cents.

The function uses internally makes use of mean and excluding all NA values (making use of its input argument na.rm = TRUE). Note that the user has to prepare the time series data, i.e. calculate for the price data with index t the corresponding price_lead with index t+x.


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