4
$\begingroup$

Disturbingly coincident with the U.S. Treasury Yield Curve's recent volatility and inversion, the previously highly reliable & available data from the Treasury's website at Treasury's website xml data format, frequently becomes unreachable.

(Note: this data requires some parsing to become useful in Mathematica).

This unavailability also affects the Treasury's Resource Center website's Daily Treasury Yield Curve Rates presentation of the information, although not as often.

Treasury Resource Center

Not certain, of the underlying cause of the problem, I turned to WolframAlpha, which raises a couple of questions.


The U.S. Treasury publishes yield curve data at the end of each trading day. As I want the most current data I can typically access it by 4:15 PM Eastern time using the following WolframAlpha query:

WolframAlpha["United States, Treasury yield curve"]

WolfraAlpha query

I can, extract the relevant data values by adding "NumberData" to the query:

WolframAlpha["United States, Treasury yield curve", "NumberData"]

{{2, 1.79, 1.61, 1.5, 1.62, 2.11}}

But, this doesn't give me all yields available for all the maturities that the Treasury supplies.

Clicking on the WolframAlpha's "More" button shows that WolframAlpha has access to all of this data:

More maturities


Question 1: How can I access the yields from all available maturities? Essentially, I want to use "NumberData", but get all of the values.

Question 2: The WolframAlpha data lags the data published on the Treasury site (when one can get to it). In the cases shown, WolframAlpha accesses the August 22, 2019 data rather than the August 23, 2019 data available on the Treasury site. Over the past couple of weeks I have seen lags of as many of 3 trading days. How come? Does any way exist to to force/direct WolframAlpha to access more current data?

Alternatively: Can I access any of this data with FinancialData[] or some other direct means? One could previously get the U.S. Treasury 30 yield prices from which one can derive the 30 yield with:

FinancialData["^TYX"]

but this doesn't seem to work anymore. The Yahoo link to this data still works. Thoughts appreciated.

$\endgroup$
  • 1
    $\begingroup$ This seems like a good question to ask on the Wolfram Community site. Not that it's not also relevant here - I just have a suspicion that the FinancialData developers are more active there. $\endgroup$ – Carl Lange Aug 26 '19 at 15:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.