# Consider you have raw trade data for 1 stock for 2 days
if (FALSE) {
tDataAfterFirstCleaning <- tradesCleanup(tDataRaw = sampleTDataRaw,
exchanges = "N", report = FALSE)
qData <- quotesCleanup(qDataRaw = sampleQDataRaw,
exchanges = "N", report = FALSE)
dim(tDataAfterFirstCleaning)
tDataAfterFinalCleaning <-
tradesCleanupUsingQuotes(qData = qData[as.Date(DT) == "2018-01-02"],
tData = tDataAfterFirstCleaning[as.Date(DT) == "2018-01-02"])
dim(tDataAfterFinalCleaning)
}
# In case you have more data it is advised to use the on-disk functionality
# via the "tradeDataSource", "quoteDataSource", and "dataDestination" arguments
Run the code above in your browser using DataLab