if (FALSE) {
# Example I: query history data
# us
FAANG = md_stock(c('META', 'AMZN', 'AAPL', 'NFLX', 'GOOG'))
# hkex
TMX = md_stock(c('00700.hk', '03690.hk', '01810.hk'))
# sse/szse
## the symbol without suffix
dt_cn1 = md_stock(c("000001", "^000001", "512510"))
## the symbol with suffix
dt_cn2 = md_stock(c("000001.sz", "000001.ss", '512510.ss'))
# Example III: query real prices
# real price for equities
dt_real1 = md_stock(c('META', 'AMZN', 'AAPL', 'NFLX', 'GOOG',
'00700.hk', '03690.hk', '01810.hk',
"000001", "^000001", "512510"), type = 'real')
# query company information
dt_info1 = md_stock('600036', type = 'info')
}
Run the code above in your browser using DataLab