> par(mfrow = c(1,2))
> hist.factor(durFactor.msftt, prob = T, xlab = "Duration.MSFT",
+ main = "Histogram of MSFT\nTransaction Durations in Seconds")
Problem: Object "durFactor.msftt" not found
Use traceback() to see the call stack
>
> hist.factor(durFactor.eurusd, prob = T, xlab = "Duration.USD/EUR",
+ main = "Histogram of USD/EUR\nQuote Durations in Seconds")
Problem: Object "durFactor.eurusd" not found
Use traceback() to see the call stack
>
> ### Temporal dependence in price changes and bid-ask bounce
> ## Two-way classification table of lead-lag price changes
> pcLag.msft = pcTicks.msft[1:(nrow(pcTicks.msft)-1),]
Problem: Object "pcTicks.msft" not found
Use traceback() to see the call stack
> pcLead.msft = pcTicks.msft[2:nrow(pcTicks.msft),]
Problem: Object "pcTicks.msft" not found
Use traceback() to see the call stack
>
> pcLagFactor.msft = cut(seriesData(pcLag.msft), breaks=c(min(pcLag.msft), -1:0, max(pcLag.msft)), include.lowest =T,
+ labels = paste("Lag.PC", c("-", "0", "+")), factor.result=T)
Problem: Object "pcLag.msft" not found
Use traceback() to see the call stack
> pcLeadFactor.msft = cut(seriesData(pcLead.msft), breaks=c(min(pcLead.msft), -1:0, max(pcLead.msft)), include.lowest =T,
+ labels = paste("Lead.PC", c("-", "0", "+")), factor.result=T)
Problem: Object "pcLead.msft" not found
Use traceback() to see the call stack
>
> table(pcLagFactor.msft, pcLeadFactor.msft)
Problem: Object "pcLagFactor.msft" not found
Use traceback() to see the call stack
>
>
> #### 3.3 Calendar Patterns in Market Activities #######
>
> ### 3.3.1 Calendar patterns in volatility ###
>
> ## MSFT ##
> ## 5-min realized volatility ##
> rv5min.msft = Genr.RealVol(ts = log(msftt.ts[, "Price"])*100,
+ interv.type = "daily", bound.hours = c("9:30", "16:00"),
+ rv.span = timeSpan("5m"), rt.span = timeSpan("1m"))
Problem in sub(ts@data, !na.idx, ): argument "x" is missing with no default
Use traceback() to see the call stack
> rv5min.msft[1:5,]
Problem: Object "rv5min.msft" not found
Use traceback() to see the call stack
>
> # Average 5-min realized volatility across days
> args(SmoothAcrossIntervs)
function(ts, n.subinterv, n.interv, FUN)
NULL
> rv5min.ave.msft = SmoothAcrossIntervs(ts = rv5min.msft, n.subinterv = 78,
+ n.interv = 11, FUN = mean)
Problem: Object "rv5min.msft" not found
Use traceback() to see the call stack
> rv5min.ave.msft@title = "5-min Realized Volatility: MSFT\n(averaging across 11 trading days)"
Problem: Object "rv5min.ave.msft" not found
Use traceback() to see the call stack
>
> par(mfrow = c(1,2))
> # ACF of the 5-min realized volatility for MSFT
> acf.plot(acf(rv5min.msft, lag.max = 234, plot = F),
+ main = "ACF of 5-min Realized Volatility:\nMSFT (lags up to 3 days)")
Problem: Object "rv5min.msft" not found
Use traceback() to see the call stack
> # Plots of Calendar pattern in realized volatility for MSFT
> plot(rv5min.ave.msft, reference.grid = F,
+ x.axis.args = list(format.label = c("%H:%02M", "%Z"),
+ time.of.day.style = "24:00"))
Problem: Object "rv5min.ave.msft" not found
Use traceback() to see the call stack
>
> ## USD/EUR ##
> ## 5-min realized volatility ##
> rv5min.eurusd = Genr.RealVol(ts = log(mq.eurusd)*100, interv.type = "weekly", bound.hours = c("22:00", "22:00"),
+ rv.span = timeSpan("5m"), rt.span = timeSpan("1m"))
Problem in sub(ts@data, !na.idx, ): argument "x" is missing with no default
Use traceback() to see the call stack
> rv5min.eurusd[1:5, ]
Problem: Object "rv5min.eurusd" not found
Use traceback() to see the call stack
>
> # Average 5-min realized volatility across days
> rv5min.ave.eurusd = SmoothAcrossIntervs(ts = rv5min.eurusd, n.subinterv = 288,
+ n.interv = 5, FUN = mean)
Problem: Object "rv5min.eurusd" not found
Use traceback() to see the call stack
> rv5min.ave.eurusd@title = "5-min Realized Volatility: USD/EUR\n(averaging across 5 trading days)"
Problem: Object "rv5min.ave.eurusd" not found
Use traceback() to see the call stack
>
> par(mfrow = c(1,2))
> # ACF of the 5-min realized volatility for USD/EUR
> acf.plot(acf(rv5min.eurusd, lag.max = 864, plot = F),
+ main = "ACF of 5-min Realized Volatility:\nUSD/EUR (lags up to 3 days)")
Problem: Object "rv5min.eurusd" not found
Use traceback() to see the call stack
> # Plots of Calendar pattern in realized volatility for USD/EUR
> plot(rv5min.ave.eurusd, reference.grid = F,
+ x.axis.args = list(format.label = c("%H:%02M", "%Z"),
+ time.of.day.style = "24:00"))
Problem: Object "rv5min.ave.eurusd" not found
Use traceback() to see the call stack
>
> ### 3.3.2 Calendar patterns in duration ###
> ## MSFT
> ## mean durations in 5-min intervals
> args(aggregateSeriesHF)
function(ts, interv.type = "daily", bound.hours = c("9:30", "16:00"), by, k.by, FUN, adj, drop.empty = F,
...)
NULL
> meanDur5min.msft = aggregateSeriesHF(duration.msftt, interv.type = "daily",
+ bound.hours = c("9:30", "16:00"), FUN = mean,
+ by = "minutes", k.by = 5, adj = 1, drop.empty = F, together = T)
Problem: Object "duration.msftt" not found
Use traceback() to see the call stack
> meanDur5min.msft[1:5,]
Problem: Object "meanDur5min.msft" not found
Use traceback() to see the call stack
>
> # averaging 5-min mean durations across trading days
> meanDur5min.ave.msft = SmoothAcrossIntervs(ts = meanDur5min.msft, n.subinterv = 78,
+ n.interv = 11, FUN = mean)
Problem: Object "meanDur5min.msft" not found
Use traceback() to see the call stack
> meanDur5min.ave.msft@title = "5-min Mean Durations: MSFT\n(averaging across 11 trading days)"
Problem: Object "meanDur5min.ave.msft" not found
Use traceback() to see the call stack
>
> # plots of ACF and calendar pattern in durations
> par(mfrow = c(1,2))
> acf.plot(acf(meanDur5min.msft, lag.max = 234, plot = F),
+ main = "ACF of 5-min Mean Durations:\nMSFT (lags up to 3 days)")
Problem: Object "meanDur5min.msft" not found
Use traceback() to see the call stack
> plot(meanDur5min.ave.msft, reference.grid = F,
+ x.axis.args = list(format.label = c("%H:%02M", "%Z"),
+ time.of.day.style = "24:00"))
Problem: Object "meanDur5min.ave.msft" not found
Use traceback() to see the call stack
>
> ## USD/EUR
> ## mean durations in 5-min intervals
> meanDur5min.eurusd = aggregateSeriesHF(duration.eurusd, interv.type = "weekly",
+ bound.hours = c("22:00", "22:00"), FUN = mean,
+ by = "minutes", k.by = 5, adj = 1, drop.empty = F, together = T)
Problem: Object "duration.eurusd" not found
Use traceback() to see the call stack
> meanDur5min.eurusd[1:5,]
Problem: Object "meanDur5min.eurusd" not found
Use traceback() to see the call stack
>
> # averaging 5-min mean durations across trading days
> meanDur5min.ave.eurusd = SmoothAcrossIntervs(ts = meanDur5min.eurusd, n.subinterv = 288,
+ n.interv = 5, FUN = mean)
Problem: Object "meanDur5min.eurusd" not found
Use traceback() to see the call stack
> meanDur5min.ave.eurusd@title = "5-min Mean Durations: USD/EUR\n(averaging across 11 trading days)"
Problem: Object "meanDur5min.ave.eurusd" not found
Use traceback() to see the call stack
>
> # plots of ACF and calendar pattern in durations
> #removing the NAs in meanDur5min before plotting ACF
> na.idx = is.na(seriesData(meanDur5min.eurusd))
Problem: Object "meanDur5min.eurusd" not found
Use traceback() to see the call stack
> par(mfrow = c(1,2))
>