Learn R Programming

RTL (version 1.3.7)

getCurve: Morningstar Commodities API forward curves

Description

Returns forward curves from Morningstar API. See below for current feeds supported. You need your own credentials with Morningstar.

Usage

getCurve(
  feed = "CME_NymexFutures_EOD_continuous",
  contract = "CL",
  numOfcontracts = 12,
  date = "2023-08-24",
  fields =
    c("open_price, high_price, low_price, settlement_price, volume, open_interest"),
  iuser = "x@xyz.com",
  ipassword = "pass"
)

Value

wide data frame. tibble

Arguments

feed

Morningstar Feed Table e.g "Crb_Futures_Price_Volume_And_Open_Interest". character

contract

Morningstar contract root e.g. "CL" for CME WTI and "BG" for ICE Brent. character

numOfcontracts

Number of listed contracts to retrieve. numeric

date

Date yyyy-mm-dd. character

fields

Defaults to c("open_price, high_price, low_price, settlement_price, volume, open_interest"). character

iuser

Morningstar user name as character - sourced locally in examples. character

ipassword

Morningstar user password as character - sourced locally in examples. character

Current Feeds Supported

  • CME_NymexFutures_EOD_continuous

Author

Philippe Cote

Examples

Run this code
if (FALSE) {
# CME WTI Futures
getCurve(
  feed = "CME_NymexFutures_EOD_continuous", contract = "CL",
  date = "2023-08-24",
  fields = c("open_price, high_price, low_price, settlement_price, volume, open_interest"),
  iuser = "x@xyz.com", ipassword = "pass"
)
}

Run the code above in your browser using DataLab