Question:
Wondering if QuantConnect can make customized restful api calls to a server?
I'm assuming it can since we can probably import an http client and build the request ourselves.
But are those calls able to be made or are they blocked?
Thanks in advance!
Konrad S
I had a similiar issue just a few days ago, still learning the platform. From what I know it is possible to use self.Download() method to request outside data. However, in debug environment that method seems to be passing requests through an API proxy and has some limits around number of requests which can be made in the backtester. From what I understand the same limit doesn't apply to live algos. Another way to do this is to use GetSource / Reader classes (this is described in the documentation. Also all requests made through typical python reguest classes seem to be rejected, so it seems self.Download seems like the best option.
Jack Simonson
Hi Oscar,
It is possible to make an API call and import external data, but the number of calls that can be made using Download in a backtest is capped at 100. However, there is no limit on live-trading. Information about importing custom data can be found here.
Ralph Zazula
What is the timeframe for the 100 limit? 100 per day? Per backtest?
I'm using an API for daily data. At 200+ days per year, I'm going to have to figure something else out... I tried to save the files off to ObjectStore so I only query for each day once, but my backtest are now just getting stuck.
Maybe I'll preload them offline and put them in one large file I can store in ObjectStore...
What is the ObjectStore limit for a single file? Overall limit?
Jared Broad
Hi Ralph, what do you mean using the REST API for daily data? Mind helping us understand the usecase?
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.
Ralph Zazula
I'm calling out to an external service to retrieve daily data to use in computing my algorithm. In a backtest scenario, that will be thousands of individual calls made from OnData(). I keep running into the 100 request limit... The dataset is about 500M if I want to download it all at once. Can I store that in ObjectStore?
Derek Melchin
Hi Ralph,
The dataset may fit in the ObjectStore. To see the amount of storage remaining:
Storage starts at 500MB but is extendable.
Best,
Derek Melchin
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.
Oscar Gonzalez-Barrios
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!