hi there !
I had an error in an algo (which basically took my 1 week to figure out .....) that was caused by the universe filter. Long story short, the filter pulled CBS's stock CBS.A. after that I was pulling the historical data and the data for CBS would not pull properly. Anyway, i recreated the error in the research env. and wanted to get your input on how I can #1 pull the data for CBS and #2 filter stocks to get the top 1500 us stocks, excluding ETFs ans all other weird/non stocks...
Here's the code I have:
Equities = ["AAPL", "FB", "AMZN", "NFLX", "GOOG", "CBS.A"]
for Symbol in Equities:
qb.AddEquity(Symbol)
qb.SetStartDate(2018,5,1)
h1 = qb.History(qb.Securities.Keys, 5, Resolution.Daily)
print(h1)
As you will see, it returns this, and no CBS data
open high low close \
symbol time
AAPL 2018-04-25 164.456848 165.112015 160.049361 161.746839
2018-04-26 161.508597 164.208679 161.210794 162.620395
2018-04-27 162.918198 164.516409 162.173691 163.017466
2018-04-28 162.799077 163.126661 159.453755 161.141306
2018-05-01 160.922917 166.030242 160.654894 164.049851
NFLX 2018-04-25 319.400000 320.240000 302.330000 307.020000
2018-04-26 306.370000 309.950000 292.600000 305.840000
2018-04-27 310.290000 316.630000 305.710000 314.090000
2018-04-28 317.290000 317.430000 306.500000 311.770000
2018-05-01 311.490000 317.900000 310.160000 312.460000
AMZN 2018-04-25 1534.990000 1539.790000 1448.430000 1460.080000
2018-04-26 1458.000000 1469.990000 1415.020000 1461.780000
2018-04-27 1485.010000 1529.320000 1478.500000 1519.280000
2018-04-28 1634.800000 1638.110000 1567.330000 1572.600000
2018-05-01 1582.500000 1596.180000 1560.940000 1566.130000
GOOG 2018-04-25 1052.400000 1057.000000 1010.500000 1019.970000
2018-04-26 1026.000000 1032.610000 1015.200000 1021.460000
2018-04-27 1030.530000 1047.990000 1018.190000 1039.850000
2018-04-28 1045.420000 1049.530000 1025.520000 1029.970000
2018-05-01 1031.280000 1037.120000 1016.700000 1017.620000
FB 2018-04-25 165.430000 166.100000 158.190000 159.690000
2018-04-26 160.130000 161.060000 156.190000 159.960000
2018-04-27 173.230000 176.270000 170.800000 174.230000
2018-04-28 176.810000 177.100000 172.600000 173.590000
2018-05-01 173.790000 175.720000 171.710000 172.020000
Want am I doing wrong ?
Thanks so much in advance !
Jing Wu
This is a data issue from our data vendor. The map file incorrectly maps this ticker to the CBSA data instead CBS.A. CBSA was delisted in the market at the end of 2012, so you didn't get the data in the notebook. We've created an issue
https://www.quantconnect.com/forum/discussion/4798/cbs-a-tick-the-issue-starts-at-the-start-of-the-data-and-continues-until-now/p1
You can subscribe to this issue to get the update information.
Stephane b
Hi Jing and thanks a lot for the info.
Ive been struggling with similar issues for the past week. Basically, I dynamicly scan a universe from which I select a few stocks but I always end up with some stocks that seem to have that same problem. Full disclosure, I select a universe with a dollarvalue within the 5 and 20 percentile.
SO the big question is, how can I simply select from my universe only stocks that are tradable AND have data ? Basically, I want to be able to analyze the stocks in my universe and when they meet my creterias, I want to be able to trade them without struggling with delisted stocks or erroneous stocks (like CBS) and what not...
I already tried filtering my fine universe with these following factors but I still end up with stocks with bugs ...:
(SecurityType == 'ST00000001') and (IsDepositaryReceipt == False) and (IsPrimaryShare)
thanks again very much in advance,
Stephane b
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!