Description Usage Arguments Value Author(s) Examples
View source: R/pub01_utilityFuncs.R
Given a event data(ussually a TS object), calculate the extra returns driven by the event.
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"))
 | 
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   | 
holdingdays | 
 a vector of integers,giving the list of holding days  | 
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.
Ruifei.Yin
1 2  | eventRtn <- getEventRtn(TS,20)
eventRtns <- getEventRtns(head(TS,10),c(-10,-5,0,5,10))
 | 
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.