Quantopian's community platform is shutting down. Please read this post for more information and download your code.
Back to Community
Save and Use a Fitted Predictive Model

Hi Quantopian Community,

Is there now a way to save a fitted model (e.g. Random Forest) and use it to predict in back-testing or live-trading environment?
Thanks a lot!

Best,
Daniel

3 responses

One cannot save or download data from the Quantopian platform. This is done to comply with contracts we have in place with data providers to ensure their data is not copied and re-published. Therefore, one cannot save fitted model results generated on the Quantopian platform. However, if one can generate data outside of the Quantopian platform, then those results can be inputted into a backtest or notebook. The approach is to use 'self serve' data. Which get's the data into a pipeline. Check out this post for info how to do that https://www.quantopian.com/posts/upload-your-custom-datasets-and-signals-with-self-serve-data

Disclaimer

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 Quantopian. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. No information contained herein should be regarded as a suggestion to engage in or refrain from any investment-related course of action as none of Quantopian nor any of its affiliates is undertaking to provide investment advice, act as an adviser to any plan or entity subject to the Employee Retirement Income Security Act of 1974, as amended, individual retirement account or individual retirement annuity, or give advice in a fiduciary capacity with respect to the materials presented herein. If you are an individual retirement or other investor, contact your financial advisor or other fiduciary unrelated to Quantopian about whether any given investment idea, strategy, product or service described herein may be appropriate for your circumstances. All investments involve risk, including loss of principal. Quantopian 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.

Hi Dan,

Thanks for your response.

I am a bit confused by the 'self serve' data concepts. Basically, I have trained a model without using Quantopian data and save it down on my local machine. I need to find a way to use it in real-time trading on Quantopian to make predictive signals. Wondering if that's something possible?

Best,
Daniel

'Self serve' data is quite simple. One creates a CSV (comma separated variable) text file with a stock symbol, date, and value. The key is that it needs to associate a value with a stock. This value could be your training parameters. The file can then be hosted and updated locally. Many users use a Google sheets document. Quantopian will then, each morning before markets open, go fetch any updates to this file. This data can then be used in either an algo or a research notebook. There is some more info in the documentation https://www.quantopian.com/docs/user-guide/tools/self-serve.

Now, as far as your second request "I need to find a way to use it in real-time trading on Quantopian". Quantopian doesn't support live trading. You can certainly backtest your results on the platform but will need to find other solutions for real-time trading.