powered by
md_forex query forex market data from FRED (history data) or sina (real data).
md_forex
md_forex(symbol, type = "history", date_range = "3y", from = NULL, to = Sys.Date(), print_step = 1L, ...)
forex symbols. Default is NULL.
the data type, available values including history and real. Default is history.
date range. Available value includes '1m'-'11m', 'ytd', 'max' and '1y'-'ny'. Default is 3y.
the start date. Default is NULL. If it is NULL, then calculate using date_range and end date.
the end date. Default is the current date.
a non-negative integer, which will print symbol name by each print_step iteration. Default is 1L.
Additional parameters.
if (FALSE) { # history data dtfx_hist1 = md_forex(c('usdcny', 'usdjpy')) # real data dtfx_real = md_forex(c('eurusd', 'usdcny', 'usdjpy'), type = 'real') }
Run the code above in your browser using DataLab