import importlib
importlib.reload(some_module)
https://stackoverflow.com/questions/1254370/reimport-a-module-in-python-while-interactive
“Life is like riding a bicycle. To keep your balance, you must keep moving.” — Albert Einstein
import importlib
importlib.reload(some_module)
https://stackoverflow.com/questions/1254370/reimport-a-module-in-python-while-interactive
For British pound, Euro, Australian dollars and New Zealand dollars, prices are quoted as USD per foreign currency ie CCYUSD=X.
For other currencies, prices are quoted as no. of foreign currency per USD ie USDCCY=X.
https://seekingalpha.com/etfs-and-funds/etf-guide
View the ETF groupings here by performance.
Next step.
When writing an algorithm on Quantopian, you have access to free minute bar historical pricing and volume data for US equities (covered in this tutorial) as well as free Morningstar fundamentals data, and third-party datasets such as news sentiment, and earnings calendars.
Morningstar fundamental-data
https://www.quantopian.com/help#fundamental-data
3rd party data set
https://www.quantopian.com/data
Quantopian provides a large set of financial data for free. The free data includes corporate fundamental data and minutely trade price and volume data from 2002 to present day for all major US exchanges. You can work with this data immediately.
Quantopian provides 26 premium sets by subscription. These premium data sets provide a free evaluation portion for you to explore in your research and use in your algorithms. These samples exclude the last 1 or 2 years worth of data, varying by set.
Free Data Set
https://www.quantopian.com/data?type=free
StockTwits Trader Mood from PsychSignal – The mood of traders posting messages on Twitter with Retweets and StockTwits
VIX S&P500 Volatility from Quandl – VIX, created by the CBOE, is a popular measure of the implied volatility of S&P 500 index options.
CBOE VXV Index from Quandl – CBOE VXV is a constant measure of 3-month implied volatility of the S&P 500 Index options
VIX S&P 500 Volatility Index from Quandl – VIX is an index created by the CBOE. This set, updated daily, is provided by Quandl via their data base of Yahoo sourced prices.
CBOE VVIX Index from Quandl – The VVIX Index is an indicator of the expected volatility of the 30-day forward price of the VIX. Calculated by CBOE, provided by Quandl
CBOE VXD Index from Quandl – CBOE VXD uses 30-day DJIA options to reflect investors’ consensus view of future (30-day) expected stock market volatility
Gold Price (USD) from Quandl – The price of gold from the Deutsche Bundesbank Data Repository
CBOE VXN Index from Quandl – CBOE VXN measures market expectations of near-term volatility conveyed by NASDAQ-100 Index option prices
Overnight LIBOR, based on US Dollar from Quandl – The average interest rate at which leading banks borrow funds of a sizeable amount from other banks in the London market.
CBOE VXMT Index from Quandl – The CBOE Mid-Term Volatility Index is a measure of the expected volatility of the S&P 500 Index over a 6-month time horizon. Calculated by CBOE, provided by Quandl
CBOE SKEW Index from Quandl – The CBOE SKEW Index is derived from the price of S&P 500 tail risk.
10 Year Swap from Quandl – Rate paid by fixed-rate payer on an interest rate swap with maturity of ten years
ADP National Employment Report from Quandl – Monthly snapshot of US private sector employment from ADP.
US vs. EUR Exchange Rate from Quandl – US Dollar to European Euro exchange rate
Civilian Unemployment Rate from Quandl – The number of unemployed as a percentage of the labor force via FRED.
US Gross Domestic Product (FRED) from Quandl – The Gross Domestic Product (GDP) of the United States, sourced from the Federal Reserve and provided by Quandl.
Continued Insured Unemployment Claims from Quandl – Seasonally adjusted, the number of people receiving unemployment benefits
Twitter Trader Mood (All Fields, with Retweets) from PsychSignal – The mood of traders posting messages on Twitter with Retweets and StockTwits
Gross National Product (GNP) for the U.S. from Quandl – Gross National Product for the U.S. from FRED
Gross Domestic Product: Implicit Price Deflator from Quandl – GDP of the U.S. with implicit price deflator, from FRED
CBOE VXFXI Index from Quandl – CBOE VXFI is the China ETF Volatility Index which reflects the implied volatility of the FXI ETF
CBOE VXXLE Index from Quandl – VXXLE is the CBOE Energy Sector ETF Volatility Index, reflecting the implied volatility of the XLE ETF
US Equity Pricing from Quantopian – Minute-level US equity pricing and volume data.
US Unemployment, Initial Claims from Quandl – Initial unemployment claims for the US, provided by FRED, the Federal Reserve Economic Data initiative.
U.S. Inflation (GDP Deflator) from Quandl – Inflation as measured by the annual growth rate of the GDP implicit deflator shows the rate of price change in the economy as a whole.
Real GDP per Capita of the U.S. from Quandl – Annual real GDP per capita of the U.S.
U.S. Inflation Rate from Quandl – Inflation rate for the U.S. as a percentage of the Consumer Price Index
Fundamental Data from Morningstar – Corporate fundamental data for over 8000 US equities.
CBOE RVX Index from Quandl – The CBOE Russell 2000 Volatility Index (RVX) is a measure of market expectations of near-term volatility conveyed by Russell 2000 stock index option prices. Calculated by CBOE, provided by Quandl
Twitter and StockTwits Trader Mood (All fields, with Retweets) from PsychSignal – The mood of traders posting messages on Twitter with Retweets and StockTwits
Twitter Trader Mood (All Fields, no Retweets) from PsychSignal – The mood of traders posting messages on Twitter without Retweets
Premium Data set –
https://www.quantopian.com/data?type=premium
Yes! A subset of each dataset is available at no charge. The volume of free sample data is different from dataset to dataset. More recent time periods require a monthly fee but you can typically access the free data by appending ‘_free’ to the name of a data set. More >>
Pipeline Data Bundle from Quantopian – Get access to all premium data feeds available through Pipeline and Research.
Mergers and Acquisitions from EventVestor – With this dataset, targets of mergers or acquisitions can be identified through pipeline.
Zacks Earnings Surprises from Zacks -Updated daily, this data set chronicles historical estimated and actual earnings and surprise calculations for 6,000 US and Canadian listed companies covering the last ten years.
Buyback Authorizations from EventVestor – Dataset of stock buyback announcements for over 4,000 listed companies.
Broker Ratings Revision History from Zacks – A history of sell-side analyst recommendations and ratings, updated monthly.
CEO Changes from EventVestor – Dataset of CEO transitions including reasons for change and source of the new CEO.
13-D Filings from EventVestor – Dataset of 13D Filings with SEC by activist shareholders disclosing a beneficial ownership of 5% or more.
Credit Facility from EventVestor – Dataset of key financial events covering new or extended credit facilities
Clinical Trials from EventVestor – Dataset of key phases of clinical trials announcements by biotech and pharmaceutical companies.
Estimize Analyst-by-Analyst Estimates from Estimize – Dataset of crowd-sourced earnings estimates. Every single individual Estimize estimate. Nearly 70% more accurate than Wall Street. This dataset is only available in Research through the Interactive namespace.
Spin-Offs from EventVestor – Dataset of events covering corporate spin-offs.
Contract Win from EventVestor – Dataset of major contract wins by companies.
Issue Debt from EventVestor – Dataset of events and announcements covering new debt issues by companies.
Shareholder Meetings from EventVestor – Dataset of annual and special shareholder meetings calendar.
Issue Equity from EventVestor – Dataset of events and announcements covering secondary equity issues by companies.
Impairments and Charges from EventVestor – Dataset of key goodwill impairments and other one time charges reported by companies.
Index Changes from EventVestor – Dataset of index additions and deletions to major S&P, Russell, and Nasdaq 100 indexes.
Share Repurchases from EventVestor – Dataset of actual share repurchase announcements by companies.
Legal and Regulatory from EventVestor – Dataset of major legal and regulatory events affecting stock prices.
Sentdex Sentiment Analysis from Sentdex – Assesses the sentiment of companies by pulling from over 20 sources such as Wall Street Journal, CNBC, Forbes, Business Insider, and Yahoo Finance
Stock Splits from EventVestor – Dataset of stock splits and reverse stock splits.
Dividends from EventVestor – Dataset of cash dividend announcements including special dividends.
Earnings Releases from EventVestor – Dataset of quarterly earnings releases.
Accern Alphaone News Sentiment from Accern – Actionable sentiment scores derived from 20 million public news and blog sources.
Earnings Calendar from EventVestor – Dataset of quarterly earnings releases calendar indicating date and time of reporting.
Earnings Guidance from EventVestor – Dataset of comprehensive forward looking earnings guidance provided by companies.
The data is available for use both in algorithms (through the pipeline API) and the Quantopian research environment (both through the pipeline API and the interactive API).
“””
This is a template algorithm on Quantopian for you to adapt and fill in.
“””
from quantopian.algorithm import attach_pipeline, pipeline_output
from quantopian.pipeline import Pipeline
from quantopian.pipeline.data.builtin import USEquityPricing
from quantopian.pipeline.factors import AverageDollarVolume
from quantopian.pipeline.filters.morningstar import Q500US
”’
Other than the standard Anaconda packages, I need to install
1. Quandl
https://docs.quandl.com/docs/installation-1
pip install Quandl
2. Schedule
https://pypi.python.org/pypi/schedule
pip install schedule
https://www.quantopian.com/tutorials/getting-started
https://www.quantopian.com/help
”’
context is a variable for maintaing parameters
The data Object
The data object contains functions that allow us to look up current or historical pricing and volume data for any security. data is available in handle_data() and before_trading_start(), as well as any scheduled functions.
data.current()
can be used to retrieve the most recent value of a given field(s) for a given asset(s). data.current() requires two arguments: the asset or list of assets, and the field or list of fields being queried. Possible fields include ‘price’, ‘open’, ‘high’, ‘low’, ‘close’, and ‘volume’. The output type will depend on the input types.
This returns the most recent price
data.current(sid(24), ‘price’)
This returns a Panda series indexed by asset, field is price
data.current([sid(24), sid(8554)], ‘price’)
This returns a Panda frame indexed by assets and fields as columns
data.current([sid(24), sid(8554)], [‘low’, ‘high’])
data.can_trade()
is used to determine if an asset(s) is currently listed on a supported exchange and can be ordered. If data.can_trade() returns True for a particular asset in a given minute bar, we are able to place an order for that asset in that minute. This is an important guard to have in our algorithm if we hand-pick the securities that we want to trade. It requires a single argument: an asset or a list of assets. The following example checks if AAPL is currently listed on a major exchange:
data.can_trade(sid(24))
data.history()
allows us to get trailing windows of historical pricing or volume data. data.history() requires 4 arguments: an asset or list of assets, a field or list of fields, an integer lookback window length, and a lookback frequency. Possible fields include ‘price’, ‘open’, ‘high’, ‘low’, ‘close’, and ‘volume’. Possible frequencies are ‘1d’ for daily and ‘1m’ for minutely.
The following example returns a pandas Series containing the price history of AAPL over the last 10 days and uses pandas.Series.mean() to calculate the mean.
# Get the 10-day trailing price history of AAPL in the form of a Series.
hist = data.history(sid(24), ‘price’, 10, ‘1d’)
# Mean price over the last 10 days.
mean_price = hist.mean()
Note: With ‘1d’ frequency, the most recent value in the result from data.history() will include a value for the current date in the simulation, which can sometimes be a value for a partial day. For example, if data.history() is called in the first minute of the day, the last row of the returned DataFrame will represent values from 9:31AM, whereas the previous 9 rows will represent end-of-day values.
To get the past 10 complete days of data, we can get an extra day of data, and drop the most recent row. The following example gets the trading volume of SPY from the last 10 complete days:
data.history(sid(8554), ‘volume’, 11, ‘1d’)[:-1].mean()
return type of data.history() depends on the input types. In the next example, the return type is a pandas DataFrame indexed by date, with assets as columns:
# Get the last 5 minutes of volume data for each security in our list.
hist = data.history([sid(24), sid(8554), sid(5061)], ‘volume’, 5, ‘1m’)
# Calculate the mean volume for each security in our DataFrame.
mean_volumes = hist.mean(axis=0)
If we pass a list of fields, we get a pandas Panel indexed by field, having date as the major axis, and assets as the minor axis:
# Low and high minute bar history for each of our securities.
hist = data.history([sid(24), sid(8554), sid(5061)], [‘low’, ‘high’], 5, ‘1m’)
# Calculate the mean low and high over the last 5 minutes
means = hist.mean()
mean_lows = means[‘low’]
mean_highs = means[‘high’]
The portfolio object stores important information about our portfolio. The portfolio object is stored in context, and as such, is accessible in each of our core functions and our scheduled functions. In this lesson, we are going to focus on the positions attribute of the portfolio object.
Our current positions are stored in context.portfolio.positions. which is similar to a Python dictionary having assets as keys, and Position objects (including information such as the number of shares and price paid) as values.
One example of when it can be useful to reference our current positions, is if we want to close out all of our open positions. To do so, we can iterate over the keys in context.portfolio.positions, and close out each position:
for security in context.portfolio.positions:
order_target_percent(security, 0)
”’
”’
initialize() is a compulsory function.
it is called only once when algo starts and requires context as input
”’
def initialize(context):
# Reference to AAPL
context.aapl = sid(24)
context.security_list = [sid(24), sid(8554), sid(5061)]
”’
scheduled function takes a long position in SPY at the start of the week, and closes out the position at 3:30pm on the last day of the week:
”’
schedule_function(open_positions, date_rules.week_start(), time_rules.market_open())
schedule_function(close_positions, date_rules.week_end(), time_rules.market_close(minutes=30))
# example of using record()
schedule_function(record_vars, date_rules.every_day(), time_rules.market_close())
”’
set_slippage() is set in initialize()
defaut model
Using the default model, if an order of 60 shares is placed for a given stock, then 1000 shares of that stock trade in each of the next several minutes and the volume_limit is 0.025, then our trade order will be split into three orders (25 shares, 25 shares, and 10 shares) that execute over the next 3 minutes.
At the end of each day, all open orders are canceled, so trading liquid stocks is generally a good idea. Additionally, orders placed exactly at market close will not have time to fill, and will be canceled.
”’
set_slippage(slippage.VolumeShareSlippage(volume_limit=0.025, price_impact=0.1))
”’
set_commission is set in initialize()
The default commission model charges $0.0075 per share, with a minimum trade cost of $1.
”’
set_commission(commission.PerShare(cost=0.0075, min_trade_cost=1))
”’
custom functions written by user for the purpose of schedule_function
”’
def open_positions(context, data):
order_target_percent(context.spy, 0.10)
def close_positions(context, data):
order_target_percent(context.spy, 0)
”’
In the IDE, the record() function allows us to plot time series charts updated as frequently as daily in backtesting or as frequently as minutely in live trading. Up to 5 series can be recorded and plotted. To record a variable, we can pass it as a keyword argument to record(). The name of the argument will be the name of the series in the plot. Recorded time series are then displayed in a chart below the returns chart.
”’
def record_vars(context, data):
long_count = 0
short_count = 0
for position in context.portfolio.positions.itervalues():
if position.amount > 0:
long_count += 1
if position.amount < 0:
short_count += 1
# Plot the counts
record(num_long=long_count, num_short=short_count)
”’
handle_data is called once at the end of each minute and requires context and data as input
”’
def handle_data(context, data):
# Position 100% of our portfolio to be long in AAPL
# different types of order method here https://www.quantopian.com/help#api-order-methods
if (data.can_trade(context.aapl):
order_target_percent(context.aapl, 1.00)
hist = data.history(context.security_list, ‘volume’, 10, ‘1m’).mean()
# print out value
print hist.mean()
”’
get_open_orders()
Orders do not always fill instantaneously. Large orders, or orders placed for illiquid securities can take some time to fill. On Quantopian, the time it takes for an order to fill is determined by the slippage model being used. If an order takes more than one minute to fill, it’s considered open until it fills. When placing new orders, it’s sometimes necessary to consider open orders.
when placing orders multiple times in the same day, open orders need to be taken into account each time a new order is placed. order_target_percent() doesn’t consider open orders when calculating the number of shares to order. Placing a new order for a security that has an outstanding open order can lead to over-ordering (ordering past the target). This can lead to an algorithm spending more money than intended.
To avoid over-ordering, we can look at open orders using get_open_orders() which returns a dictionary of open orders keyed by assets. We can use this to ensure that we don’t have an open order for a security before we place a new order for it.
”’
Get all open orders.
open_orders = get_open_orders()
if context.aapl not in open_orders and data.can_trade(context.aapl):
order_target_percent(context.aapl, 1.0)
”’
before_trading_start is called once per day and requires context and data as input
often used to select securities to order
”’
def before_trading_start(context, data):
# do something
Quantopian’s example in full
https://www.quantopian.com/tutorials/getting-started#lesson11
Sector | Industry | Coy |
Basic Industries | Agricultural Chemicals | 18 |
Basic Industries | Aluminum | 2 |
Basic Industries | Containers/Packaging | 1 |
Basic Industries | Electric Utilities: Central | 3 |
Basic Industries | Engineering & Construction | 10 |
Basic Industries | Environmental Services | 5 |
Basic Industries | Forest Products | 12 |
Basic Industries | General Bldg Contractors – Nonresidential Bldgs | 1 |
Basic Industries | Home Furnishings | 2 |
Basic Industries | Homebuilding | 8 |
Basic Industries | Major Chemicals | 80 |
Basic Industries | Metal Fabrications | 8 |
Basic Industries | Military/Government/Technical | 8 |
Basic Industries | Mining & Quarrying of Nonmetallic Minerals (No Fuels) | 21 |
Basic Industries | Miscellaneous | 1 |
Basic Industries | Other Specialty Stores | 1 |
Basic Industries | Package Goods/Cosmetics | 6 |
Basic Industries | Paints/Coatings | 5 |
Basic Industries | Paper | 12 |
Basic Industries | Precious Metals | 83 |
Basic Industries | Specialty Chemicals | 5 |
Basic Industries | Steel/Iron Ore | 22 |
Basic Industries | Telecommunications Equipment | 5 |
Basic Industries | Textiles | 4 |
Basic Industries | Water Supply | 7 |
Capital Goods | Aerospace | 11 |
Capital Goods | Auto Manufacturing | 17 |
Capital Goods | Auto Parts:O.E.M. | 37 |
Capital Goods | Automotive Aftermarket | 1 |
Capital Goods | Biotechnology: Laboratory Analytical Instruments | 19 |
Capital Goods | Building Materials | 15 |
Capital Goods | Building Products | 8 |
Capital Goods | Construction/Ag Equipment/Trucks | 13 |
Capital Goods | Containers/Packaging | 3 |
Capital Goods | Electrical Products | 32 |
Capital Goods | Electronic Components | 6 |
Capital Goods | Engineering & Construction | 4 |
Capital Goods | Fluid Controls | 8 |
Capital Goods | Homebuilding | 23 |
Capital Goods | Industrial Machinery/Components | 86 |
Capital Goods | Industrial Specialties | 12 |
Capital Goods | Marine Transportation | 5 |
Capital Goods | Medical Specialities | 3 |
Capital Goods | Metal Fabrications | 35 |
Capital Goods | Military/Government/Technical | 15 |
Capital Goods | Ordnance And Accessories | 5 |
Capital Goods | Pollution Control Equipment | 5 |
Capital Goods | Railroads | 6 |
Capital Goods | Specialty Chemicals | 3 |
Capital Goods | Steel/Iron Ore | 7 |
Capital Goods | Tools/Hardware | 1 |
Capital Goods | Wholesale Distributors | 2 |
Consumer Durables | Automotive Aftermarket | 23 |
Consumer Durables | Building Products | 7 |
Consumer Durables | Consumer Electronics/Appliances | 5 |
Consumer Durables | Consumer Specialties | 5 |
Consumer Durables | Containers/Packaging | 16 |
Consumer Durables | Diversified Electronic Products | 2 |
Consumer Durables | Electrical Products | 4 |
Consumer Durables | Electronic Components | 1 |
Consumer Durables | Home Furnishings | 20 |
Consumer Durables | Industrial Machinery/Components | 1 |
Consumer Durables | Industrial Specialties | 9 |
Consumer Durables | Metal Fabrications | 5 |
Consumer Durables | Miscellaneous manufacturing industries | 8 |
Consumer Durables | Office Equipment/Supplies/Services | 4 |
Consumer Durables | Publishing | 2 |
Consumer Durables | Specialty Chemicals | 16 |
Consumer Durables | Telecommunications Equipment | 16 |
Consumer Non-Durables | Apparel | 30 |
Consumer Non-Durables | Beverages (Production/Distribution) | 28 |
Consumer Non-Durables | Consumer Electronics/Appliances | 7 |
Consumer Non-Durables | Consumer Specialties | 2 |
Consumer Non-Durables | Electronic Components | 13 |
Consumer Non-Durables | Environmental Services | 1 |
Consumer Non-Durables | Farming/Seeds/Milling | 18 |
Consumer Non-Durables | Food Chains | 3 |
Consumer Non-Durables | Food Distributors | 15 |
Consumer Non-Durables | Homebuilding | 2 |
Consumer Non-Durables | Meat/Poultry/Fish | 8 |
Consumer Non-Durables | Motor Vehicles | 2 |
Consumer Non-Durables | Package Goods/Cosmetics | 10 |
Consumer Non-Durables | Packaged Foods | 45 |
Consumer Non-Durables | Plastic Products | 12 |
Consumer Non-Durables | Recreational Products/Toys | 11 |
Consumer Non-Durables | Shoe Manufacturing | 9 |
Consumer Non-Durables | Specialty Foods | 8 |
Consumer Non-Durables | Telecommunications Equipment | 5 |
Consumer Non-Durables | Textiles | 1 |
Consumer Non-Durables | Tobacco | 1 |
Consumer Services | Advertising | 12 |
Consumer Services | Automotive Aftermarket | 1 |
Consumer Services | Books | 3 |
Consumer Services | Broadcasting | 32 |
Consumer Services | Building operators | 10 |
Consumer Services | Catalog/Specialty Distribution | 18 |
Consumer Services | Clothing/Shoe/Accessory Stores | 36 |
Consumer Services | Consumer Electronics/Video Chains | 6 |
Consumer Services | Consumer Specialties | 5 |
Consumer Services | Consumer: Greeting Cards | 1 |
Consumer Services | Department/Specialty Retail Stores | 23 |
Consumer Services | Diversified Commercial Services | 8 |
Consumer Services | Electronics Distribution | 1 |
Consumer Services | Farming/Seeds/Milling | 9 |
Consumer Services | Food Chains | 9 |
Consumer Services | Home Furnishings | 7 |
Consumer Services | Homebuilding | 3 |
Consumer Services | Hotels/Resorts | 34 |
Consumer Services | Marine Transportation | 25 |
Consumer Services | Military/Government/Technical | 13 |
Consumer Services | Motor Vehicles | 3 |
Consumer Services | Movies/Entertainment | 11 |
Consumer Services | Newspapers/Magazines | 14 |
Consumer Services | Office Equipment/Supplies/Services | 4 |
Consumer Services | Other Consumer Services | 58 |
Consumer Services | Other Specialty Stores | 38 |
Consumer Services | Paper | 2 |
Consumer Services | Professional Services | 18 |
Consumer Services | Publishing | 4 |
Consumer Services | RETAIL: Building Materials | 14 |
Consumer Services | Real Estate | 8 |
Consumer Services | Real Estate Investment Trusts | 243 |
Consumer Services | Recreational Products/Toys | 2 |
Consumer Services | Rental/Leasing Companies | 6 |
Consumer Services | Restaurants | 64 |
Consumer Services | Services-Misc. Amusement & Recreation | 22 |
Consumer Services | Telecommunications Equipment | 17 |
Consumer Services | Television Services | 30 |
Consumer Services | Transportation Services | 10 |
Energy | Coal Mining | 13 |
Energy | Consumer Electronics/Appliances | 6 |
Energy | Electric Utilities: Central | 2 |
Energy | Industrial Machinery/Components | 18 |
Energy | Integrated oil Companies | 26 |
Energy | Metal Fabrications | 13 |
Energy | Natural Gas Distribution | 23 |
Energy | Oil & Gas Production | 181 |
Energy | Oil Refining/Marketing | 15 |
Energy | Oilfield Services/Equipment | 19 |
Finance | Accident &Health Insurance | 7 |
Finance | Banks | 20 |
Finance | Business Services | 95 |
Finance | Commercial Banks | 52 |
Finance | Diversified Commercial Services | 2 |
Finance | Diversified Financial Services | 4 |
Finance | Finance Companies | 6 |
Finance | Finance/Investors Services | 5 |
Finance | Finance: Consumer Services | 72 |
Finance | Investment Bankers/Brokers/Service | 65 |
Finance | Investment Managers | 44 |
Finance | Life Insurance | 34 |
Finance | Major Banks | 369 |
Finance | Property-Casualty Insurers | 98 |
Finance | Real Estate | 42 |
Finance | Savings Institutions | 74 |
Finance | Specialty Insurers | 19 |
Health Care | Biotechnology: Biological Products (No Diagnostic Substances) | 90 |
Health Care | Biotechnology: Commercial Physical & Biological Resarch | 24 |
Health Care | Biotechnology: Electromedical & Electrotherapeutic Apparatus | 34 |
Health Care | Biotechnology: In Vitro & In Vivo Diagnostic Substances | 23 |
Health Care | Hospital/Nursing Management | 33 |
Health Care | Industrial Specialties | 24 |
Health Care | Major Pharmaceuticals | 393 |
Health Care | Medical Electronics | 3 |
Health Care | Medical Specialities | 37 |
Health Care | Medical/Dental Instruments | 104 |
Health Care | Medical/Nursing Services | 19 |
Health Care | Ophthalmic Goods | 3 |
Health Care | Other Pharmaceuticals | 6 |
Health Care | Precision Instruments | 3 |
Miscellaneous | Business Services | 90 |
Miscellaneous | Industrial Machinery/Components | 20 |
Miscellaneous | Multi-Sector Companies | 18 |
Miscellaneous | Office Equipment/Supplies/Services | 7 |
Miscellaneous | Other Consumer Services | 3 |
Miscellaneous | Publishing | 7 |
Public Utilities | Electric Utilities: Central | 79 |
Public Utilities | Environmental Services | 7 |
Public Utilities | Natural Gas Distribution | 41 |
Public Utilities | Oil & Gas Production | 7 |
Public Utilities | Oil/Gas Transmission | 14 |
Public Utilities | Power Generation | 27 |
Public Utilities | Telecommunications Equipment | 97 |
Public Utilities | Water Supply | 15 |
Technology | Advertising | 12 |
Technology | Computer Communications Equipment | 18 |
Technology | Computer Manufacturing | 14 |
Technology | Computer Software: Prepackaged Software | 142 |
Technology | Computer Software: Programming, Data Processing | 41 |
Technology | Computer peripheral equipment | 17 |
Technology | Diversified Commercial Services | 24 |
Technology | EDP Services | 121 |
Technology | Electrical Products | 16 |
Technology | Electronic Components | 11 |
Technology | Industrial Machinery/Components | 40 |
Technology | Professional Services | 22 |
Technology | Radio And Television Broadcasting And Communications Equipment | 35 |
Technology | Retail: Computer Software & Peripheral Equipment | 5 |
Technology | Semiconductors | 111 |
Technology | Telecommunications Equipment | 2 |
Transportation | Aerospace | 3 |
Transportation | Air Freight/Delivery Services | 21 |
Transportation | Marine Transportation | 44 |
Transportation | Oil Refining/Marketing | 11 |
Transportation | Other Transportation | 1 |
Transportation | Railroads | 10 |
Transportation | Transportation Services | 6 |
Transportation | Trucking Freight/Courier Services | 19 |
n/a | n/a | 1550 |
Just ran through analysis on the data from NASDAQ symbol list. As of 13 Jan 2017, there are 12 different types of sectors.
Sector Type | No. of companies | % | Market Cap (billion) | Market Cap % |
Basic Industries | 330 | 6% | 1.98E+03 | 6% |
Capital Goods | 382 | 7% | 2.12E+03 | 6% |
Consumer Durables | 144 | 3% | 4.01E+02 | 1% |
Consumer Non-Durables | 231 | 4% | 2.43E+03 | 7% |
Consumer Services | 824 | 16% | 4.75E+03 | 13% |
Energy | 316 | 6% | 3.17E+03 | 9% |
Finance | 1008 | 19% | 5.72E+03 | 16% |
Health Care | 796 | 15% | 4.09E+03 | 12% |
Miscellaneous | 145 | 3% | 1.15E+03 | 3% |
Public Utilities | 287 | 6% | 3.04E+03 | 9% |
Technology | 631 | 12% | 5.88E+03 | 17% |
Transportation | 115 | 2% | 6.80E+02 | 2% |
n/a | 1550 | 5.07E+02 |
These include all companies listed on NYSE, NASDAQ and AMEX but excludes companies that are not categorized. as any of the above. As of today, there are 1550 companies that do not belong to any of the category above.
Market cap wise in %, it looks fairly similar to the number of companies which obviously makes sense. Looking at companies under Technology, with the rise of companies like Apple and Facebook, it probably explains why tech companies make up 12% of total but 17% of total market cap.
in place. Decided to move from miniquant.com to a free blog website goldenjumper.wordpress.com. This will relieve me of paying for the domain name at cheapdomain.com though the domain name is valid for another 1 year but that’s fine.
Recently went through with a hefty transaction so will want to save cost as much as possible.