Hi all
I'm using FRED data in my algorithm like so:
self.high_yield=self.add_data(Fred, Fred.ICEBofAML.US_HIGH_YIELD_MASTER_II_OPTION_ADJUSTED_SPREAD , Resolution.DAILY).symboland later on:
if data.ContainsKey(self.high_yield):
self.high_yield_value = data[self.high_yield].ValueBut I'm getting this error on Live trading:
Error downloading custom data source file, skipped: RemoteFile: UnfoldingCollection https://api.stlouisfed.org/fred/series/observations?file_type=json&observation_start=1998-01-01&api_key=&series_id=bamlh0a0hym2 Error: The reader was empty for source: $https://api.stlouisfed.org/fred/series/observations?file_type=json&observation_start=1998-01-01&api_key=&series_id=bamlh0a0hym2
Can someone please help/advise on how to use this data correctly for live trading? It works in back testing, just not live trading. I know there's an missing API key, what is the easiest way to supply that for live trading
appreciate your help
cheers
V
Mia Alissi
Hi Varun,
The error message you're seeing indicates that the API key for the FRED data source is missing. This is required to access the data for live trading.
In your
GetSourcemethod, you need to include your API key in the URL. Here's an example from one of the discussions:Replace
YOUR_API_KEYwith your actual FRED API key.Also, for live trading with custom data, you might need to ensure your data is remotely accessible and use the
SubscriptionTransportMedium.Restproperty to retrieve data from the custom data source periodically. This property causes the URL provided to the custom data source to be polled at each timestep in the algorithm.Here's a reference from one of the discussions:
Please refer to the documentation on importing custom data for more details.
I hope this helps!
Sources:
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.
Varun uppal
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!