WOLFRAM NOTEBOOK

In[]:=
yields=WolframAlpha["United States, Treasury yield Curve","NumberData"]
Out[]=
{{1.03,2.07,2.6,2.8,2.78,2.99}}
In[]:=
maturities={1,2,5,10,20,30}
Out[]=
{1,2,5,10,20,30}
In[]:=
yieldValues=Transpose[{maturities,First[yields]}]
Out[]=
{{1,1.03},{2,2.07},{5,2.6},{10,2.8},{20,2.78},{30,2.99}}
In[]:=
ListPlot[yieldValues,JoinedTrue,FillingAxis]
Out[]=
In[]:=
DateListPlot[FinancialData["SHY","Jan 1 2022"]]
Out[]=
In[]:=
DateListPlot[FinancialData["TLT","Jan 1 2022"]]
Out[]=
In[]:=
DateListPlot[{FinancialData["TLT","CumulativeFractionalChange",{2001}],FinancialData["SHY","CumulativeFractionalChange",{2001}]},JoinedTrue,FillingBottom]
Out[]=
Wolfram Cloud

You are using a browser not supported by the Wolfram Cloud

Supported browsers include recent versions of Chrome, Edge, Firefox and Safari.


I understand and wish to continue anyway »

You are using a browser not supported by the Wolfram Cloud. Supported browsers include recent versions of Chrome, Edge, Firefox and Safari.