Learn R Programming

RTL (version 1.2.0)

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 = "Crb_Futures_Price_Volume_And_Open_Interest",
  contract = "CL",
  date = "2020-08-10",
  fields = c("Open, High, Low, Close"),
  iuser = "x@xyz.com",
  ipassword = "pass"
)

Value

wide data frame

Arguments

feed

Morningstar Feed Table e.g "Crb_Futures_Price_Volume_And_Open_Interest".

contract

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

date

From date as character string.

fields

Defaults to c("Open, High, Low, Close").

iuser

Morningstar user name as character - sourced locally in examples.

ipassword

Morningstar user password as character - sourced locally in examples.

Current Feeds Supported

  • Crb_Futures_Price_Volume_And_Open_Interest

  • CME_NymexFuturesIntraday_EOD

  • ICE_EuroFutures and ICE_EuroFutures_continuous

Author

Philippe Cote

Examples

Run this code
if (FALSE) {
# CME WTI Futures
getCurve(
  feed = "Crb_Futures_Price_Volume_And_Open_Interest", contract = "CL",
  date = "2020-07-13", fields = c("Open, High, Low, Close"),
  iuser = "x@xyz.com", ipassword = "pass"
)

getCurve(
  feed = "Crb_Futures_Price_Volume_And_Open_Interest", contract = "BG",
  date = "2020-07-13", fields = c("Open, High, Low, Close"),
  iuser = "x@xyz.com", ipassword = "pass"
)

getCurve(
  feed = "LME_ClosingPriceDelayed", contract = "AHD",
  date = "2021-06-25", fields = c("Last_Price"),
  iuser = "x@xyz.com", ipassword = "pass"
)
}

Run the code above in your browser using DataLab