plotTQData: Plot Trade and Quote data

View source: R/plotTQData.R

plotTQDataR Documentation

Plot Trade and Quote data

Description

Plot trade and quote data, trades are marked by crosses, and quotes are plotted as boxes denoting the bid-offer spread for all the quotes.

Usage

plotTQData(
  tData,
  qData = NULL,
  xLim = NULL,
  tradeCol = "black",
  quoteCol = "darkgray",
  format = "%H:%M:%S",
  axisCol = "black",
  ...
)

Arguments

tData

cleaned trades data

qData

cleaned quotes data

xLim

timestamps for the start and the end of the plots.

tradeCol

color in which to paint the trade crosses.

quoteCol

color in which to fill out the bid-offer spread.

format

format string to pass to axis.POSIXct when creating the timestamps on the x axis. If you are plotting a very short time interval, use "%H:%M:%OS" to get fractional seconds on the time axis.

axisCol

string to denote which color to use for the x axis

...

passed to plot and points.

Examples

## Not run: 
cleanedQuotes = quotesCleanup(qDataRaw = sampleQDataRaw, report = FALSE, printExchange = FALSE)
cleanedTrades <- tradesCleanupUsingQuotes(
        tData = tradesCleanup(tDataRaw = sampleTDataRaw, report = FALSE, printExchange = FALSE),
        qData = quotesCleanup(qDataRaw = sampleQDataRaw, report = FALSE, printExchange = FALSE)
        )[as.Date(DT) == "2018-01-03"]
xLim <- range(as.POSIXct(c("2018-01-03 15:30:00", "2018-01-03 16:00:00"), tz = "EST"))
plotTQData(cleanedTrades, cleanedQuotes, xLim = xLim, 
           main = "Raw trade and quote data from NYSE TAQ")

## End(Not run)

highfrequency documentation built on Oct. 4, 2023, 5:08 p.m.