#' @title Tick Data
#' @description Get tick data
#'
#' @param symbol Stock ticker
#' @param date Date for data
#' @param limit ???
#' @param skip ???
#' @param format return data type. Default is json
#'
#' @importFrom tibble as_tibble
#'
#' @return
#' @export
#'
#' @examples
#' tick_data('NVDA')
tick_data <- function(symbol,
date = today()-5,
limit = '500',
skip = '0',
format = 'json',
...){
url <- finnhub_endpoint('tick_data')
df <- retry_get(url,
query = list(token = finnhub_key(),
symbol = symbol,
date = date,
limit = limit,
skip = skip,
format = format))
symbol <- df[['s']]
skipped = df[['skip']]
count <- df[['count']]
total_ticks <- df[['total']]
volume <- df[['v']]
prices <- df[['p']]
unixtime <- as.character(df[['t']])
exchanges <- df[['x']]
tibble::tibble(symbol, unixtime, prices, volume, exchanges, total_ticks,
count, skipped)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.