Message Boards Message Boards

GROUPS:

Get financial tickers for commodities using FinancialData?

Posted 2 months ago
403 Views
|
1 Reply
|
0 Total Likes
|

Hi there,

I am using FinancialData with great success for stocks, currencies and ETFs. However I am struggling to get prices for commodities (Metals, grains...). Not sure whether this is available as usually traded at Chicago Board of Trade (CBOT-CME) or London Metal Exchange and cannot find their tickers.

Thanks for your support, Miguel

Posted 1 month ago

Hi Miguel,

This is possible for listed futures.

FinancialData will call the same database as Wolfram Alpha does, so the easy "cheat" is to use Wolfram Alpha to discover the exchange and ticker for the commodity you want.

For example, to find WTI Crude this query will help:

https://www.wolframalpha.com/input/?i=wti+oil+futures

You'll note this in the output

wolfram alpha query cap

This gives you the product code ("CL") and the exchange code ("NYMEX") that will be the ticker to use in FinancialData.

You can then write the Financial Data query as normal:

FinancialData["NYMEX:CL","Close",{2010,1,1}]

That query will return the TimeSeries of the closing prices since 2010

I will say that this can be quite unstable for less "popular" commodities such as ags...but, after two or three tries, the data populates.

In short, if the commodity / fx / rate / equity future is on ICE, CME, NYMEX, CBOT then you can probably pull the timeseries via FinancialData.

Hope that helps!

Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract