count_functions {RITCH} | R Documentation |
Counts the messages of an ITCH-file
Description
Counts the messages of an ITCH-file
Usage
count_messages(
file,
add_meta_data = FALSE,
buffer_size = -1,
quiet = FALSE,
force_gunzip = FALSE,
gz_dir = tempdir(),
force_cleanup = TRUE
)
count_orders(x)
count_trades(x)
count_modifications(x)
count_system_events(x)
count_stock_directory(x)
count_trading_status(x)
count_reg_sho(x)
count_market_participant_states(x)
count_mwcb(x)
count_ipo(x)
count_luld(x)
count_noii(x)
count_rpii(x)
Arguments
file |
the path to the input file, either a gz-file or a plain-text file |
add_meta_data |
if the meta-data of the messages should be added, defaults to FALSE |
buffer_size |
the size of the buffer in bytes, defaults to 1e8 (100 MB), if you have a large amount of RAM, 1e9 (1GB) might be faster |
quiet |
if TRUE, the status messages are supressed, defaults to FALSE |
force_gunzip |
only applies if file is a gz-file and a file with the same (gunzipped) name already exists. if set to TRUE, the existing file is overwritten. Default value is FALSE |
gz_dir |
a directory where the gz archive is extracted to.
Only applies if file is a gz archive. Default is |
force_cleanup |
only applies if file is a gz-file. If force_cleanup=TRUE, the gunzipped raw file will be deleted afterwards. |
x |
a file or a data.table containing the message types and the counts,
as outputted by |
Details
-
count_orders
: Counts order messages. Message typeA
andF
-
count_trades
: Counts trade messages. Message typeP
,Q
andB
-
count_modifications
: Counts order modification messages. Message typeE
,C
,X
,D
, andU
-
count_system_events
: Counts system event messages. Message typeS
-
count_stock_directory
: Counts stock trading messages. Message typeR
-
count_trading_status
: Counts trading status messages. Message typeH
andh
-
count_reg_sho
: Counts messages regarding reg SHO. Message typeY
-
count_market_participant_states
: Counts messages regarding the status of market participants. Message typeL
-
count_mwcb
: Counts messages regarding Market-Wide-Circuit-Breakers (MWCB). Message typeV
andW
-
count_ipo
: Counts messages regarding IPOs. Message typeK
-
count_luld
: Counts messages regarding LULDs (limit up-limit down) auction collars. Message typeJ
-
count_noii
: Counts Net Order Imbalance Indicatio (NOII) messages. Message typeI
-
count_rpii
: Counts Retail Price Improvement Indicator (RPII) messages. Message typeN
Value
a data.table containing the message-type and their counts for count_messages
or an integer value for the other functions.
Examples
file <- system.file("extdata", "ex20101224.TEST_ITCH_50", package = "RITCH")
count_messages(file)
count_messages(file, add_meta_data = TRUE, quiet = TRUE)
# file can also be a .gz file
gz_file <- system.file("extdata", "ex20101224.TEST_ITCH_50.gz", package = "RITCH")
count_messages(gz_file, quiet = TRUE)
# count only a specific class
msg_count <- count_messages(file, quiet = TRUE)
# either count based on a given data.table outputted by count_messages
count_orders(msg_count)
# or count orders from a file and not from a msg_count
count_orders(file)
### Specific class count functions are:
count_orders(msg_count)
count_trades(msg_count)
count_modifications(msg_count)
count_system_events(msg_count)
count_stock_directory(msg_count)
count_trading_status(msg_count)
count_reg_sho(msg_count)
count_market_participant_states(msg_count)
count_mwcb(msg_count)
count_ipo(msg_count)
count_luld(msg_count)
count_noii(msg_count)
count_rpii(msg_count)