We're proud to announce that we now support Morningstar Sector, Industry Group, and Industry codes! Sector, Industry Group, and Industry codes sort stocks based on their general market classification, with Sector being the coarsest classification (i.e, Energy) and Industry the finest-grained classification (i.e., Oil and Gas Drilling, Oil and Gas Midstream, etc.). This classification information is part of the Fundamental Data library and can be accessed like any other Fundamental Data in an algorithm.
To demonstrate these new features, we've created a Universe Selection module that returns exclusively Symbols in the banking industry. The Coarse Selection does our initial filtering for stocks with Fundamental Data and positive volume and price. The Morningstar industry filtering is done in the Fine Selection function using MorningstarIndustryGroupCode.Banks (which is equivalent to 10320, and the full list of codes can be found here). Our final list of Symbols will be banking stocks with positive trading volume and price, sorted in descending order of liquidity.
Morningstar Industry/Sector codes and other asset classification helpers are available as part of our Fundamental Data Library, and you can view the code for this and check out the other features on GitHub here. We've attached a backtest that gives a simple demonstration of how you can incorporate our new Fundamental Data features into your code and use our new Universe Selection module -- Banking Stocks!
def SelectCoarse(self, algorithm, coarse):
'''
Performs a coarse selection:
-The stock must have fundamental data
-The stock must have positive previous-day close price
-The stock must have positive volume on the previous trading day
'''
if algorithm.Time.month == self.lastMonth:
return self.symbols
filtered = [x for x in coarse if x.HasFundamentalData and x.Volume > 0 and x.Price > 0]
sortedByDollarVolume = sorted(filtered, key = lambda x: x.DollarVolume, reverse=True)[:self.numberOfSymbolsCoarse]
self.symbols.clear()
self.dollarVolumeBySymbol.clear()
for x in sortedByDollarVolume:
self.symbols.append(x.Symbol)
self.dollarVolumeBySymbol[x.Symbol] = x.DollarVolume
return self.symbols
def SelectFine(self, algorithm, fine):
## Performs a fine selection for companies in the Morningstar Banking Sector
if algorithm.Time.month == self.lastMonth:
return self.symbols
self.lastMonth = algorithm.Time.month
# Filter for banking stocks using MorningstarIndustryGroupCode.Banks (equivalently, this is 10320)
filteredFine = [x for x in fine if x.AssetClassification.MorningstarIndustryGroupCode == MorningstarIndustryGroupCode.Banks]
sortedByDollarVolume = []
# Sort stocks on dollar volume
sortedByDollarVolume = sorted(filteredFine, key = lambda x: self.dollarVolumeBySymbol[x.Symbol], reverse=True)
self.symbols = [x.Symbol for x in sortedByDollarVolume[:self.numberOfSymbolsFine]]
return self.symbols
SLPAdvisory
Extremely grateful for this!
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.
Michael Manus
very useful
Valery T
Stevin Chac
HanByul P
Jimmy Hendricks
Elliot Parker
Huy Hoang
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.
Michael Manus
Dear QC - Team put this example please in the tutorials and and post a link to the tutorials somewhere. in the community forum is a link to the github examples so maybe.........
this post is maybe very very important for others and should be highlighted. on the right side in the forum below the github examples links is some space for prominent/vip code examples.
this post will disappear in a few weaks and no one will ever find it, except if you pin it somewhere
:)
Jared Broad
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.
Mike HU
It woudl be helpful that minimal examples were avaialble in all supported languages (just like on MS sites you can click C# or C++). Otherwise it's not even clear if that's spcific to python only
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.
Link Liang
Hi Mike,
Here is our documentation regarding Morningstar Asset Classification. Both C# and Python example code snippet are there. I have also converted the example from JayJay to C# in this backtest, hope it would help you get started with this exciting feature!
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.
Aleksandr Nalivajko
Thx for that.
Can I make SelectCourse return not only a list of symbols, but also IndustryGroupCode of those symbols?
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.
Alethea Lin
Hi Aleksandr,
Fundamental data is selected and accessed via fine fundamental universe selection, so you can return the IndustryGroupCode along with the symbols in the fine selection step. To get the industry code, you will use “.AssetClassification.MorningstarIndustryGroupCode” command.
Check out “Data Library – Fundamentals” to learn more about using fundamental data!
Hope this helps and thanks for your support!
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.
E Katir
Thank you, Jared and QC Team, This is a a great milestone!
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.
Pangyuteng
Just signed into Alpaca's slack, looks like there is no upddate yet. I had to liquidate my positions manually, and switch to QC's paper trading to continue forward testing!
fyi. below is the response from one of Alpaca's staff a month ago:
"Alpaca is still in the process of working with QuantConnect to resolve these issues. No ETA on a final fix. A positive step is that there is a solid technical solution, however the implementation needs to be worked out which involves some changes on the QuantConnect side. We'll keep everyone posted."
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.
Jared Broad
pangyuteng Sorry you were impacted.
FYI it has nothing to do with technical changes. We have finished Tradier implementation which is also a $0 fee brokerage; and will install it into the website after that Alpha Market bug fixes have settled down =).
Onwards and upwards!
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.
OkiTrader
Update- Alpaca has crossed the last line. The polygon.io support is no longer supported. Now you will have to pay $199 for market data. Surprised how things went quickly downhill.
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.
Jared Broad
Ouch =(
Connor -- It's done in LEAN now we are working hard fighting a few fires in live trading then will be in a more stable place to deploy Tradier to the website. Hopefully next week.
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.
Robert Koch
The loss of polygon is particulalry bad, and means I'll be moving away from Alpaca. I've found that their in house historical data is quite bad, and it also is missing a lot of volume. Too bad.
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.
OkiTrader
I agree polygon.io was a key feature. I was using it to practice building my own SQL database, CRUD operations. Using this database I would run my paper trading algos. It's the hard way, but learned a lot while doing it. Their in-house historical data is terrible, especially for minute data. Additionally, when I tried intraday queries it would sometimes break. Even the documentation provided by support would sometimes fix the bugs. Definitely think you would lose money if you tried to trade live with them.
Gained an appreciation of QuantConnect and where it is going.
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.
Shile Wen
Hi Conner,
The Tradier support has been merged, and we will make it available to QC Cloud as soon as possible. A great way to get the current statuses of features is through the Issues or PRs pages on Github, and subscribe to the threads to get notifications.
Once it is available, to use the brokerage, use the following line of code in Initialize: self.SetBrokerageModel(BrokerageName.TradierBrokerage)
Best,
Shile Wen
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.
Jared Broad
Shipped this afternoon, let me know if there are any issues. Officially still in "beta" mode.
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.
Superfatkorean
Hey guys Ive notcied tradier isnt insured. Should I be worried about this ?
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.
Derek Melchin
Hi Superfatkorean,
Please open a dedicated thread for this question, since it's outside of the scope of this thread and other members may want to comment.
If you'd feel safer with some protection, consider using Interactive Brokers. They offer some Account Protection.
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.
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!