I have a situation where I am pulling stocks based on morning star fundamental data, and end up investing in multiple versions of the same underlying (eg class A and class B shares)?
Anyone know the best way to exclude the 'duplicates'?
I have a situation where I am pulling stocks based on morning star fundamental data, and end up investing in multiple versions of the same underlying (eg class A and class B shares)?
Anyone know the best way to exclude the 'duplicates'?
Do you know specifically which securities you'd like to exclude? If so, then you could establish your universe of securities to trade by excluding those, and keeping everything else. Although a manual process, this should work for backtesting (using the Quantopian research platform might make the task easier, since it now supports get_fundamentals()). For paper/real money trading, I don't know of a fully automated approach. It might be that you'll just need to do some preemptive manual screens, and then use fetcher or an embedded list in the algo code to exclude specific securities?
You could try is_primary_share -- see this post.