Hi all,
My algo needs a forward looking risk free rate input. Say the 10-year Treasury yield. It does not need to be updated very frequently (daily is fine).
At first I happily used this source:
https://www.quantconnect.com/docs/alternative-data/us-department-of-treasuryBut silly me did not notice the very obvious warning that the above source only works in backtesting. So in live (AlphaStreams) my algo has been defaulting to a hard-coded default value. That is clearly not optimal.
What best/easiest alternative would you suggest for the risk free rate in live?
By the way, what exact input for the risk free rate does QC use to compute statistics that depend on it (such as Sharpe Ratio, Alpha-Beta...)?
Thanks in advance
Pangyuteng
One way is through Quandl. Not the prettiest, but it works!
Pierre Vidal
Hi Ted,
Thanks for the suggestion, much appreciated! Quandl looks like the best alternative at this point, will try that.
I assume Quandl is now considered a "supported" data source in QC and as such allowed in Alpha Streams?
Best
Jared Broad
Unfortunately due to the concentration of requests from a single IP Quandl has flagged us as spam and it actually doesn't work in Alpha Streams live. We're working on getting them to white list the account but now they're owned by NASDAQ everything is moving incredibly slow. Its been 3 months waiting...
You can go directly to the source in the meantime -- the reserve. We're in the process of hosting and caching that data (to avoid getting IP blocked) but for now, for individuals as long as you don't spam them!) its OK to get it directly.
The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.
Pierre Vidal
Hi Jared,
Thanks for taking the time to explain, and sorry for the Quandl situation. Hoping this will be positively resolved soon.
About going to source as you mentioned, if I understand well this is QuantConnect.Data.Custom.USTreasury and as previously noted that only works in backtest (not in Alpha Streams / Live)...
My understanding is that we are also not allowed to use the download() function directly in Alpha competitions and Alpha Streams. Let me know if I missed something.
Best
Pierre Vidal
Sharing a quick update on this thread:
I went for a temporary alternative solution, which is to use the US 10Y Gov bond yield from the Trading Economics source.
The source is marked as free for Alpha Streams use. The particular data point I am interested in can be subscribed to using:
self.AddData(TradingEconomicsCalendar, TradingEconomics.Calendar.UnitedStates.GovernmentBondTenY)
Now the data appears to only update once a month... That is still not ideal, but, for my purpose, already much better than using 2% no matter what... Looking forward to future updates on Quandl and other possible alternatives.
Pangyuteng
One more try. Straight from the data source with the use of PythonData. There is always a chance that this gets blocked.
source url: https://fred.stlouisfed.org/graph/fredgraph.csv?id=DGS10,DGS2
Jared Broad
Hey Pierre -- we'll soon support the official QC cached feed in live trading (hopefully less than 2 weeks) for alpha streams and general live trading. Until then for personal trading, you can connect directly to the US treasury feed above or better via Ted's direct link above.
The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.
Pierre Vidal
Thanks Jared for clear summary, and Ted for impressive code sample.
I know exactly what to do now.
Best
Josh M
the only problem with using the 'PythonData' feed as suggested by Ted is that URL based data is blocked from being submitted as an alpha :(
Understandable, but just a heads up if that was your intention
Pierre Vidal
The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.
To unlock posting to the community forums please complete at least 30% of Boot Camp.
You can continue your Boot Camp training progress from the terminal. We hope to see you in the community soon!