getEventRtn: getEventRtn

Description Usage Arguments Value Author(s) Examples

View source: R/pub01_utilityFuncs.R

Description

Given a event data(ussually a TS object), calculate the extra returns driven by the event.

Usage

1
2
3
4
5
getEventRtn(TS, holdingday, bmk = "EI000300", fee = 0,
  tradeType = c("close", "nextavg", "nextopen"))

getEventRtns(TS, holdingdays, bmk = "EI000300", fee = 0,
  tradeType = c("close", "nextavg", "nextopen"))

Arguments

TS

a TS object.

holdingday

a integer, giving the holding day.

bmk

a character string,giving the stockID of the benchmark index,eg. "EI000300".

fee

a mumeric, giving the one side fee of trading.

tradeType

a character string("close","nextavg","nextopen"),indicating the trading type.See detail in getPeriodrtn

holdingdays

a vector of integers,giving the list of holding days

Value

getEventRtn return a data frame with cols:"stockID","date","endT","rtn","bmkRtn","exRtn".

getEventRtns return a data frame(with cols same as return of getEventRtn),which is a rbind of returns of getEventRtn by different holdingdays.

Author(s)

Ruifei.Yin

Examples

1
2
eventRtn <- getEventRtn(TS,20)
eventRtns <- getEventRtns(head(TS,10),c(-10,-5,0,5,10))

QuantAndrew/QUtility documentation built on May 14, 2019, 7:36 a.m.