Back

Set Universe based on a list of stocks from an external file

Hi QC community,

I am new to QC and trying to do develop my algo here. The first question I am having now is how to set/restrict the universe from a list of stock symbols from an extenal file. For example:

CSV (external file):

date,symbol

2015/10/01,AAPL

2015/10/02,MSFT

 

What I want is on 2015/10/01, the algo knows it can only trade AAPL and on 2015/10/02, both AAPL and MSFT can be traded by the algo.

 

thanks a lot!

Update Backtest








What you are looking for is what we call "Custom Universe Selection".
Here is a thread where we discuss it:

https://www.quantconnect.com/forum/discussion/919/feature-universe-using-remote-symbol-selection

In Michael's example, remote files are stored in Dropbox. Since they have changed their policy for public folder, there could be an issue. Fortunatelly, the algorithm runs sucessfully.

0

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.


Hi Alexandre Catarino 

Thanks for the response. I was wondering if Dropbox is the only option here. Can I use Google Drive? Thanks!

0

We can use any hosting service as long as you can use System.Net.WebClient to fetch the data.

0

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.


 Alexandre Catarino The System.Net link is broken... 403 Forbidden

0

Sorry, it shouldn't be a link, but here is the link to WebClient class: WebClient Class.

0

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.


Update Backtest





0

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.


Loading...

This discussion is closed