QuantRocket

Function "download_master_file" returns only 2 securities


#1

from quantrocket.license import set_license
from quantrocket.master import download_master_file, create_universe
import pandas as pd
from quantrocket.fundamental import collect_shortable_shares
set_license(“xxxxxxxx”)
download_master_file(“securities.csv”, exchanges=[“NASDAQ”])
securities = pd.read_csv(“securities.csv”)
print(securities)


ConId Symbol  Etf SecType PrimaryExchange Currency LocalSymbol  \

0 265598 AAPL 0 STK NASDAQ USD AAPL
1 272093 MSFT 0 STK NASDAQ USD MSFT

TradingClass MarketName LongName … UnderSecType
0 NMS NMS APPLE INC … NaN
1 NMS NMS MICROSOFT CORP … NaN

                                   MarketRuleIds  Strike Right ComboLegs  \

0 26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,2… 0.0 NaN NaN
1 26,26,26,26,26,26,26,26,26,26,26,26,26,26,26,2… 0.0 NaN NaN

Cusip EvRule EvMultiplier Delisted DateDelisted
0 NaN NaN 0.0 0 NaN
1 NaN NaN 0.0 0 NaN

[2 rows x 37 columns]


#2

That’s the sample data, so it doesn’t think you have NASDAQ permission. Did you select NASDAQ as your exchange on your account page and then refresh your license profile? Setting or viewing your license will print out your subscribed exchanges so see what it says.


#3

This is what set license returns:

{‘licensekey’: ‘xxxxxx’,
‘account’: {‘account_limit’: ‘100000 USD’},
‘concurrent_installs’: 2,
‘exchanges’: [‘NASDAQ’],
‘plan’: {‘name’: ‘Bottle Rocket (Monthly)’, ‘currency’: ‘USD’}}


#4

The problem remains, “download_master_file” returns only 2 securities.


#5

Maybe you haven’t actually collected the listings yet?

https://www.quantrocket.com/docs/#universe-collect-listings


#6

This will require a connected IB gateway, does collect listings require a IB data subscription ?

BTW, I was intending to take a look at the Short Sale Data, by documentation, “No IB market data subscriptions are required to access this dataset but you must have the appropriate exchange permissions in QuantRocket.”

How do I bypass collect listings and access the Short Sale Data ?


#7

You don’t need any IB data subscriptions but you do need an IB account to collect listings. And you need listings to get short sale data.