Hello, my fine filter includes stocks that do not match my coarse requirements.
public IEnumerable<Symbol> CoarseSelectionFilter(IEnumerable<CoarseFundamental> coarse)
{
if(Time.Month == lastMonth) {
return Universe.Unchanged;
}
lastMonth = Time.Month;
//2. Save coarse as _coarse and return an Unchanged Universe
var _coarse = coarse;
var filteredByPrice = coarse.Where(x => x.HasFundamentalData & x.Market == Market.USA & x.Price > 5).Select(x => x.Symbol);
foreach(var finalSymbol in filteredByPrice) {
if(!finalCoarse.Contains(finalSymbol)) {
finalCoarse.Add(finalSymbol);
}
}
*/
var filteredByPrice = coarse.Where(x => x.HasFundamentalData & x.Market == Market.USA & x.Price > 5).Select(x => x.Symbol);
return filteredByPrice;
}
Fine Filter:
public IEnumerable<Symbol> FineSelectionFunction(IEnumerable<FineFundamental> fine)
{
var _fine = fine;
int cntr = 0;
// SELECT 2% Dividend Yield & $5B Market Cap
var CDC_Criteria = fine.Where(x => x.ValuationRatios.TrailingDividendYield >= 0.02m & x.MarketCap > 5e9).Select(x => x.Symbol);
CDC_Criteria = CDC_Criteria.Take(10);
}
Debug( " ------------------ UNIVERSE FINE SELECTION -------------------------");
foreach(var fineSymb in CDC_Criteria) {
cntr = cntr + 1;
Debug(" " + cntr.ToString() + ": " + fineSymb);
}
return CDC_Criteria;
}
RESULTS:
017-01-01 00:00:00 :1: ABB S3MVQ2U3Z59H2017-01-01 00:00:00 :2: ABBV VCY032R250MD2017-01-01 00:00:00 :3: ABT R735QTJ8XC9X2017-01-01 00:00:00 :4: ACC T142WIKPMLPH2017-01-01 00:00:00 :5: ACL R735QTJ8XC9X2017-01-01 00:00:00 :6: ACP R735QTJ8XC9X2017-01-01 00:00:00 :7: ADM R735QTJ8XC9X2017-01-01 00:00:00 :8: ADI R735QTJ8XC9X2017-01-01 00:00:00 :9: AES R735QTJ8XC9X2017-01-01 00:00:00 :10: AEE R735QTJ8XC9X
ACL was changed to AXDX:US from ACL:GR – Greek exchange, not US.
Please help me understand if the fine is actually applied to the Coarse. If it is, one would not expect the Greek stock to appear.
Varad Kabade
Hi Craig McWilliams,
QuantConnect/Lean does not support greek equities yet. Chubb Limited (CB) was ACL from 19980102 until 20010329, then changed the ticker to ACE from 20010329 until 20160114 when it assumed the CB ticker.
Best,
Varad Kabade
Craig McWilliams
Hello Varad. Ok, so if QC does not support Greek equities, then how did the unverse coarse filter return it when the criteria included Market.USA?
Varad Kabade
Hi Craig McWilliams,
As mentioned above this was due to a SymbolChanged event for the given ticker. We recommend going through the following docs regarding more information on SymbolChanged events.
Best,
Varad Kabade
Craig McWilliams
Thank you Varad!
Craig McWilliams
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!