[R-SIG-Finance] Rblpapi / getBars / eventType

Oleg Mubarakshin o|eg@mub@r@k@h|n @end|ng |rom gm@||@com
Wed Sep 20 00:36:59 CEST 2023


Hi Dirk and all,

It's said that for getBars:
eventType = c("TRADE", "BID", "ASK")

What is the 'eventType' exactly?

The results for different types look confusing:

eventType = "TRADE"

> head(x)                times  open  high   low close numEvents volume   value
1 2023-03-08 01:00:00 81.91 82.27 81.87 82.19        77     79 6480.73
2 2023-03-08 01:15:00 82.20 82.20 82.10 82.10         2      2  164.30
3 2023-03-08 01:30:00 82.11 82.19 82.03 82.03        62     63 5173.13
4 2023-03-08 01:45:00 82.13 82.19 82.06 82.14        23     23 1888.74
5 2023-03-08 02:00:00 82.06 82.21 82.05 82.20        27     31 2546.49
6 2023-03-08 02:15:00 82.22 82.22 82.22 82.22         1      1   82.22


eventType = "BID"

> head(x)                times  open  high   low close numEvents volume     value
1 2023-03-08 00:50:01 81.73 82.07 81.67 82.06      1413   8667  710390.1
2 2023-03-08 01:05:01 82.06 82.25 82.05 82.19      2663  19367 1590846.2
3 2023-03-08 01:20:01 82.19 82.20 82.03 82.17      1867  14048 1153414.9
4 2023-03-08 01:35:01 82.17 82.18 82.00 82.06      1483  11796  968171.6
5 2023-03-08 01:50:01 82.05 82.16 82.03 82.13      1677  15189 1247051.2
6 2023-03-08 02:05:01 82.13 82.21 82.10 82.14      1176  12131  996505.2


eventType = "ASK"

> head(x)                times  open  high   low close numEvents volume     value
1 2023-03-08 00:50:01 81.81 82.10 81.75 82.09      1440   9533  781562.4
2 2023-03-08 01:05:01 82.09 82.29 82.07 82.23      3739  37173 3055594.0
3 2023-03-08 01:20:01 82.23 82.23 82.06 82.20      2268  17855 1466788.4
4 2023-03-08 01:35:01 82.20 82.20 82.01 82.08      1856  15223 1249880.9
5 2023-03-08 01:50:01 82.08 82.20 82.06 82.17      1495  12756 1047894.9
6 2023-03-08 02:05:01 82.17 82.23 82.13 82.17      1487  16442 1351371.2



Code was:
x <- getBars(security = "COQ3 Comdty",
             eventType = c("TRADE", "BID", "ASK")[1],
             barInterval = 15,
             startTime = as.POSIXct("2023-03-03"),
             endTime = as.POSIXct("2023-07-16"),
             options = NULL,
             verbose = FALSE,
             returnAs = getOption("blpType", "matrix"),
             tz = Sys.getenv("TZ", unset = "UTC"),
             con = bb.con)


Thanks.

-- 
Kind regards,
Oleg

	[[alternative HTML version deleted]]



More information about the R-SIG-Finance mailing list