
Last chance! 50% off unlimited learning
Sale ends in
Commodity swap pricing from exchange settlement
swapCOM(
futures = futs,
futuresNames = c("CL0M", "CL0N"),
pricingDates = c("2020-05-01", "2020-05-30"),
contract = "cmewti",
exchange = "nymex"
)
Wide data frame of futures prices for the given swap pricing dates
Tickers of relevant futures contracts
Vector of start and end pricing dates as character. See example.
Contract code in data(expiry_table). sort(unique(expiry_table$cmdty)) for options.
Exchange code in data(holidaysOil). Currently only "nymex" and "ice" supported.
Data frame of histocial swap prices.
# NOT RUN {
c <- paste0("CL0", c("M", "N", "Q"))
futs <- getPrices(
feed = "CME_NymexFutures_EOD", contracts = c, from = "2019-08-26",
iuser = username, ipassword = password
)
swapCOM(
futures = futs, futuresNames = c("CL0M", "CL0N"),
pricingDates = c("2020-05-01", "2020-05-30"), contract = "cmewti", exchange = "nymex"
)
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab