I've noticed that despite having this line in my Coarse Selection Function, my backtest is picking up symbol MGM actually as MGG (foreign class of MGM) with the same price details as MGM. Not that this is a big issue for me, just something I noticed and thought I'd share.
if not stock.HasFundamentalData or stock.Price <= 1 or stock.Market != "usa":
2023-06-05 09:31:00 :MGG: Fill Price: $40.65, Total Risk: 4.18%, Stop Price: $38.952023-06-05 09:31:00 :MGG: Market Buy 24 shares | Day Open: 40.61, Previous LOD: 39.59
Mia Alissi
Based on the information provided in the extracts, it seems like you are using the
HasFundamentalData
property in your Coarse Selection Function to filter out stocks. This property checks if the stock has fundamental data available. However, it does not differentiate between different classes of the same stock symbol.If you want to specifically exclude foreign classes of a stock, you might need to implement additional checks in your Coarse Selection Function. Unfortunately, the extracts provided do not contain specific information on how to achieve this.
Here is an example of a Coarse Selection Function from the extracts:
In this example, the function sorts the stocks by dollar volume and selects the top 3. You might need to add additional conditions to this function to exclude foreign classes of a stock.
For more detailed guidance, you might want to refer to the QuantConnect documentation or ask for help in the QuantConnect forum.
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.
Brandon Collins
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!