Learn R Programming

RTL (version 0.1.5)

getPrice: getPrice

Description

Returns data from Morningstar API. See below for current feeds supported. You need your own credentials with Morningstar. In examples sourced locally.

Usage

getPrice(
  feed = "CME_NymexFutures_EOD",
  contract = "@CL0Z",
  from = "2020-09-01",
  iuser = "x@xyz.com",
  ipassword = "pass"
)

Arguments

feed

Morningstar Feed Table.

contract

Morningstar key.

from

From date as character string

iuser

Morningstar user name as character - sourced locally in examples.

ipassword

Morningstar user password as character - sourced locally in examples.

Value

wide data frame

Current Feeds Supported

  • CME_CbotFuturesEOD and CME_CbotFuturesEOD_continuous

  • CME_NymexFutures_EOD and CME_NymexFutures_EOD_continuous

  • CME_NymexOptions_EOD

  • CME_CmeFutures_EOD and CME_CmeFutures_EOD_continuous

  • CME_Comex_FuturesSettlement_EOD and CME_Comex_FuturesSettlement_EOD_continuous

  • LME_AskBidPrices_Delayed

  • SHFE_FuturesSettlement_RT

  • ICE_EuroFutures and ICE_EuroFutures_continuous

  • ICE_NybotCoffeeSugarCocoaFutures and ICE_NybotCoffeeSugarCocoaFutures_continuous

  • CME_STLCPC_Futures

  • CFTC_CommitmentsOfTradersCombined. Requires multiple keys. Separate them by a space e.g. "N10 06765A NYME 01".

  • Morningstar_FX_Forwards. Requires multiple keys. Separate them by a space e.g. "USDCAD 2M".

Examples

Run this code
# NOT RUN {
getPrice(feed="CME_NymexFutures_EOD",contract="@CL0Z",
from="2019-08-26",iuser = username, ipassword = password)
getPrice(feed="CME_NymexFutures_EOD",contract="@CL21Z",
from="2019-08-26",iuser = username, ipassword = password)
getPrice(feed="CME_NymexFutures_EOD_continuous",contract="CL_006_Month",
from="2019-08-26",iuser = username, ipassword = password)
getPrice(feed="CME_NymexOptions_EOD",contract="@LO21ZP4000",
from="2020-03-15",iuser = username, ipassword = password)
getPrice(feed="CME_CbotFuturesEOD",contract="C0Z",
from="2019-08-26",iuser = username, ipassword = password)
getPrice(feed="CME_CbotFuturesEOD_continuous",contract="ZB_001_Month",
from="2019-08-26",iuser = username, ipassword = password)
getPrice(feed="CME_CmeFutures_EOD_continuous",contract="HE_006_Month",
from="2019-08-26",iuser = username, ipassword = password)
getPrice(feed="Morningstar_FX_Forwards",contract="USDCAD 2M",
from="2019-08-26",iuser = username, ipassword = password)
getPrice(feed="CME_CmeFutures_EOD",contract="LH0N",
from="2019-08-26",iuser = username, ipassword = password)
getPrice(feed="CME_CmeFutures_EOD_continuous",contract="HE_006_Month",
from="2019-08-26",iuser = username, ipassword = password)
getPrice(feed="ICE_EuroFutures",contract="BRN0Z",
from="2019-08-26",iuser = username, ipassword = password)
getPrice(feed="ICE_EuroFutures_continuous",contract="BRN_001_Month",
from="2019-08-26",iuser = username, ipassword = password)
getPrice(feed="ICE_NybotCoffeeSugarCocoaFutures",contract="SB21H",
from="2019-08-26",iuser = username, ipassword = password)
getPrice(feed="ICE_NybotCoffeeSugarCocoaFutures_continuous",contract="SF_001_Month",
from="2019-08-26",iuser = username, ipassword = password)
# }

Run the code above in your browser using DataLab