Description Usage Arguments Value Examples
Consolidate prices at a specified resolution
1 2 | consolidate_prices(date, time, price, size, date_format = "%Y-%m-%d",
time_format = "%H:%M:%OS", on = "seconds", k = 1)
|
date |
transaction date strings |
time |
transaction time strings |
price |
a tranaction prices |
size |
a transaction sizes |
date_format |
the format for the sys_date column (default is "%Y-%m-%d"). |
time_format |
the format for the sys_time column (default is "%H:%M:%S.%f"). |
on |
the resolution to consolidate trades. The default is "seconds" and any resolution supported by the xts::endpoints function is valid. |
k |
along every k-th elements. For example if "seconds" is specified as the "on" parameter and k=2 then prices are consolidated for every 2 seconds. |
an xts object with (vwapped) price, max price, min price, and volume.
1 2 3 4 5 6 7 8 9 | # Consolidate TAQ trades...
data(aapl_taq)
ctp = consolidate_prices(aapl_taq$sys_date, aapl_taq$sys_time,
aapl_taq$td_price, aapl_taq$td_size, date_format="%Y%m%d",
time_format="%H:%M:%S")
# or FIX trades...
data(aapl_fix)
cfp = consolidate_prices(aapl_fix$sys_date, aapl_fix$sys_time,
aapl_fix$td_price, aapl_fix$td_size)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.