{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Finding Symbols\n", "\n", "\n", "Finding the ticker symbol, security identifier, the sector, and other metadata is easy if you know where to look. This guide is intended to introduce some methods for searching, screening, and discovery.\n", "\n", "For maximum coverage and functionality, install OpenBB with `[all]` packages.\n", "\n", "The examples here will assume that the OpenBB Platform has been installed, the environment is active, and it has been imported into a Python session. If the installation is fresh, or an extension was just installed, the Python interface will need to be rebuilt. It will only take a few moments to complete." ] }, { "cell_type": "code", "execution_count": 1, "metadata": {}, "outputs": [], "source": [ "from openbb import obb\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The simplest way to find tickers for a company is with a simple fuzzy query.\n", "\n", "## Search the SEC\n", "\n", "Perform a quick search using the `openbb-sec` provider.\n", "\n", "### Find a Company\n", "\n", "Use an empty string, `\"\"`, to return the complete list - over 10,000." ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "10840" ] }, "execution_count": 2, "metadata": {}, "output_type": "execute_result" } ], "source": [ "all_companies = obb.equity.search(\"\", provider=\"sec\")\n", "\n", "len(all_companies.results)\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The SEC sorts this list by market cap. Applying the `to_df()` method to `all_companies` will show Apple on top" ] }, { "cell_type": "code", "execution_count": 3, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
symbolnamecik
0AAPLApple Inc.320193
1MSFTMICROSOFT CORP789019
2GOOGLAlphabet Inc.1652044
3AMZNAMAZON COM INC1018724
4NVDANVIDIA CORP1045810
5METAMeta Platforms, Inc.1326801
6BRK-BBERKSHIRE HATHAWAY INC1067983
7TSLATesla, Inc.1318605
8LLYELI LILLY & Co59478
9VVISA INC.1403161
\n", "
" ], "text/plain": [ " symbol name cik\n", "0 AAPL Apple Inc. 320193\n", "1 MSFT MICROSOFT CORP 789019\n", "2 GOOGL Alphabet Inc. 1652044\n", "3 AMZN AMAZON COM INC 1018724\n", "4 NVDA NVIDIA CORP 1045810\n", "5 META Meta Platforms, Inc. 1326801\n", "6 BRK-B BERKSHIRE HATHAWAY INC 1067983\n", "7 TSLA Tesla, Inc. 1318605\n", "8 LLY ELI LILLY & Co 59478\n", "9 V VISA INC. 1403161" ] }, "execution_count": 3, "metadata": {}, "output_type": "execute_result" } ], "source": [ "all_companies.to_df().head(10)\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Find an Institution\n", "\n", "Some reporting companies, like invesment trusts and insurance companies, do not have a ticker symbol directly associated with them. Filers in the US will have a CIK number, used to retrieve documents from the SEC." ] }, { "cell_type": "code", "execution_count": 4, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
namecik
0BERKSHIRE HATHAWAY ENERGY CO0001081316
1BERKSHIRE HATHAWAY FINANCE CORP0001274791
2BERKSHIRE HATHAWAY HOMESTATE INSURANCE CO.0000829771
3BERKSHIRE HATHAWAY INC /DE/0000109694
4BERKSHIRE HATHAWAY INC/DE0000109694
5BERKSHIRE HATHAWAY INC0001067983
6BERKSHIRE HATHAWAY LIFE INSURANCE CO OF NEBRASKA0001015867
7LMZ & BERKSHIRE HATHAWAY CO0001652795
\n", "
" ], "text/plain": [ " name cik\n", "0 BERKSHIRE HATHAWAY ENERGY CO 0001081316\n", "1 BERKSHIRE HATHAWAY FINANCE CORP 0001274791\n", "2 BERKSHIRE HATHAWAY HOMESTATE INSURANCE CO. 0000829771\n", "3 BERKSHIRE HATHAWAY INC /DE/ 0000109694\n", "4 BERKSHIRE HATHAWAY INC/DE 0000109694\n", "5 BERKSHIRE HATHAWAY INC 0001067983\n", "6 BERKSHIRE HATHAWAY LIFE INSURANCE CO OF NEBRASKA 0001015867\n", "7 LMZ & BERKSHIRE HATHAWAY CO 0001652795" ] }, "execution_count": 4, "metadata": {}, "output_type": "execute_result" } ], "source": [ "instututions = obb.regulators.sec.institutions_search(\"Berkshire Hathaway\").to_df()\n", "instututions\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Find a Filing\n", "\n", "Search for filings by CIK or ticker symbol." ] }, { "cell_type": "code", "execution_count": 11, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "type 13F-NT\n", "link https://www.sec.gov/Archives/edgar/data/000082...\n", "report_date 2023-09-30\n", "accepted_date 2023-11-14 16:15:06+00:00\n", "act 34\n", "items \n", "primary_doc_description \n", "primary_doc xslForm13F_X02/primary_doc.xml\n", "accession_number 0000950123-23-010929\n", "file_number 028-02226\n", "film_number 231406391\n", "is_inline_xbrl 0\n", "is_xbrl 0\n", "size 2960\n", "complete_submission_url https://www.sec.gov/Archives/edgar/data/000082...\n", "filing_detail_url https://www.sec.gov/Archives/edgar/data/000082...\n", "Name: 2023-11-14 00:00:00, dtype: object" ] }, "execution_count": 11, "metadata": {}, "output_type": "execute_result" } ], "source": [ "homestate_filings = obb.equity.fundamental.filings(cik=\"0000829771\", provider=\"sec\")\n", "\n", "homestate_filings.to_df().iloc[-1]\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Or, search by form type." ] }, { "cell_type": "code", "execution_count": 13, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "type 4\n", "link https://www.sec.gov/Archives/edgar/data/000032...\n", "report_date 2023-11-10\n", "accepted_date 2023-11-14 18:31:09+00:00\n", "act \n", "items \n", "primary_doc_description FORM 4\n", "primary_doc xslF345X05/wk-form4_1700004649.xml\n", "accession_number 0000320193-23-000109\n", "file_number \n", "film_number \n", "is_inline_xbrl 0\n", "is_xbrl 0\n", "size 5066\n", "complete_submission_url https://www.sec.gov/Archives/edgar/data/000032...\n", "filing_detail_url https://www.sec.gov/Archives/edgar/data/000032...\n", "Name: 2023-11-14 00:00:00, dtype: object" ] }, "execution_count": 13, "metadata": {}, "output_type": "execute_result" } ], "source": [ "aapl_filings = obb.equity.fundamental.filings(\"AAPL\", type=\"4\", provider=\"sec\")\n", "\n", "aapl_filings.to_df().iloc[-1]\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Screen Markets\n", "\n", "Screeners provide a targeted search, a tool for comparison and discovery. Find stocks from around the world with the screener endpoint, and the `openbb-fmp` provider.\n", "\n", "### Find Stocks From India" ] }, { "cell_type": "code", "execution_count": 16, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "1822" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
symbolnamemarket_capsectorindustrybetapricelast_annual_dividendvolumeexchangeexchange_namecountryis_etfactively_trading
0RELIANCE.NSReliance Industries Limited15895961017165EnergyOil & Gas Refining & Marketing0.7214092349.3592244671NSENational Stock Exchange of IndiaINFalseTrue
1TCS.NSTata Consultancy Services Limited12878392323686TechnologyInformation Technology Services0.5283519.6361473232NSENational Stock Exchange of IndiaINFalseTrue
2HDFCBANK.NSHDFC Bank Limited11345550050918Financial ServicesBanks—Regional0.7142851505.2199665132NSENational Stock Exchange of IndiaINFalseTrue
3ICICIBANK.NSICICI Bank Limited6456176076595Financial ServicesBanks—Regional0.808921.45810561389NSENational Stock Exchange of IndiaINFalseTrue
4INFY.NSInfosys Limited5945857635942TechnologyInformation Technology Services0.5961436.6363584088NSENational Stock Exchange of IndiaINFalseTrue
\n", "
" ], "text/plain": [ " symbol name market_cap \\\n", "0 RELIANCE.NS Reliance Industries Limited 15895961017165 \n", "1 TCS.NS Tata Consultancy Services Limited 12878392323686 \n", "2 HDFCBANK.NS HDFC Bank Limited 11345550050918 \n", "3 ICICIBANK.NS ICICI Bank Limited 6456176076595 \n", "4 INFY.NS Infosys Limited 5945857635942 \n", "\n", " sector industry beta price \\\n", "0 Energy Oil & Gas Refining & Marketing 0.721409 2349.35 \n", "1 Technology Information Technology Services 0.528 3519.6 \n", "2 Financial Services Banks—Regional 0.714285 1505.2 \n", "3 Financial Services Banks—Regional 0.808 921.45 \n", "4 Technology Information Technology Services 0.596 1436.6 \n", "\n", " last_annual_dividend volume exchange exchange_name \\\n", "0 9 2244671 NSE National Stock Exchange of India \n", "1 36 1473232 NSE National Stock Exchange of India \n", "2 19 9665132 NSE National Stock Exchange of India \n", "3 8 10561389 NSE National Stock Exchange of India \n", "4 36 3584088 NSE National Stock Exchange of India \n", "\n", " country is_etf actively_trading \n", "0 IN False True \n", "1 IN False True \n", "2 IN False True \n", "3 IN False True \n", "4 IN False True " ] }, "execution_count": 16, "metadata": {}, "output_type": "execute_result" } ], "source": [ "results = obb.equity.screener(country=\"IN\", provider=\"fmp\").to_df()\n", "display(len(results))\n", "results.head(5).convert_dtypes()\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Search by Sector" ] }, { "cell_type": "code", "execution_count": 17, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "190" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
symbolnamemarket_capsectorindustrybetapricelast_annual_dividendvolumeexchangeexchange_namecountryis_etfactively_trading
0HDFCBANK.NSHDFC Bank Limited11345550050918Financial ServicesBanks—Regional0.7142851505.219.09665132NSENational Stock Exchange of IndiaINFalseTrue
1ICICIBANK.NSICICI Bank Limited6456176076595Financial ServicesBanks—Regional0.808921.458.010561389NSENational Stock Exchange of IndiaINFalseTrue
2SBIN.NSState Bank of India5031248625920Financial ServicesBanks—Regional0.74563.7511.312710950NSENational Stock Exchange of IndiaINFalseTrue
3BAJFINANCE.NSBajaj Finance Limited4282998873754Financial ServicesCredit Services0.9477068.630.01901753NSENational Stock Exchange of IndiaINFalseTrue
4LICI.NSLife Insurance Corporation of India3870900117504Financial ServicesInsurance—Life<NA>612.03.0500820NSENational Stock Exchange of IndiaINFalseTrue
\n", "
" ], "text/plain": [ " symbol name market_cap \\\n", "0 HDFCBANK.NS HDFC Bank Limited 11345550050918 \n", "1 ICICIBANK.NS ICICI Bank Limited 6456176076595 \n", "2 SBIN.NS State Bank of India 5031248625920 \n", "3 BAJFINANCE.NS Bajaj Finance Limited 4282998873754 \n", "4 LICI.NS Life Insurance Corporation of India 3870900117504 \n", "\n", " sector industry beta price \\\n", "0 Financial Services Banks—Regional 0.714285 1505.2 \n", "1 Financial Services Banks—Regional 0.808 921.45 \n", "2 Financial Services Banks—Regional 0.74 563.75 \n", "3 Financial Services Credit Services 0.947 7068.6 \n", "4 Financial Services Insurance—Life 612.0 \n", "\n", " last_annual_dividend volume exchange exchange_name \\\n", "0 19.0 9665132 NSE National Stock Exchange of India \n", "1 8.0 10561389 NSE National Stock Exchange of India \n", "2 11.3 12710950 NSE National Stock Exchange of India \n", "3 30.0 1901753 NSE National Stock Exchange of India \n", "4 3.0 500820 NSE National Stock Exchange of India \n", "\n", " country is_etf actively_trading \n", "0 IN False True \n", "1 IN False True \n", "2 IN False True \n", "3 IN False True \n", "4 IN False True " ] }, "execution_count": 17, "metadata": {}, "output_type": "execute_result" } ], "source": [ "sector_results = obb.equity.screener(country=\"IN\", sector=\"Financial Services\", provider=\"fmp\").to_df()\n", "display(len(sector_results))\n", "sector_results.head(5).convert_dtypes()\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Search by Industry" ] }, { "cell_type": "code", "execution_count": 20, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "119" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
symbolnamemarket_capsectorindustrybetapricelast_annual_dividendvolumeexchangeexchange_namecountryis_etfactively_trading
0PAGEIND.NSPage Industries Limited418555116755Consumer CyclicalApparel Manufacturing0.46237525.45300.011199NSENational Stock Exchange of IndiaINFalseTrue
1KPRMILL.NSK.P.R. Mill Limited284132900800Consumer CyclicalApparel Manufacturing0.689831.254.15342210NSENational Stock Exchange of IndiaINFalseTrue
2ABFRL.NSAditya Birla Fashion and Retail Limited203500974285Consumer CyclicalApparel Manufacturing0.152214.4<NA>1363689NSENational Stock Exchange of IndiaINFalseTrue
3TRIDENT.NSTrident Limited189060118374Consumer CyclicalTextile Manufacturing0.53237.10.367863777NSENational Stock Exchange of IndiaINFalseTrue
4WELSPUNIND.NSWelspun India Limited157481652339Consumer CyclicalTextile Manufacturing0.423162.050.13348644NSENational Stock Exchange of IndiaINFalseTrue
\n", "
" ], "text/plain": [ " symbol name market_cap \\\n", "0 PAGEIND.NS Page Industries Limited 418555116755 \n", "1 KPRMILL.NS K.P.R. Mill Limited 284132900800 \n", "2 ABFRL.NS Aditya Birla Fashion and Retail Limited 203500974285 \n", "3 TRIDENT.NS Trident Limited 189060118374 \n", "4 WELSPUNIND.NS Welspun India Limited 157481652339 \n", "\n", " sector industry beta price \\\n", "0 Consumer Cyclical Apparel Manufacturing 0.462 37525.45 \n", "1 Consumer Cyclical Apparel Manufacturing 0.689 831.25 \n", "2 Consumer Cyclical Apparel Manufacturing 0.152 214.4 \n", "3 Consumer Cyclical Textile Manufacturing 0.532 37.1 \n", "4 Consumer Cyclical Textile Manufacturing 0.423 162.05 \n", "\n", " last_annual_dividend volume exchange exchange_name \\\n", "0 300.0 11199 NSE National Stock Exchange of India \n", "1 4.15 342210 NSE National Stock Exchange of India \n", "2 1363689 NSE National Stock Exchange of India \n", "3 0.36 7863777 NSE National Stock Exchange of India \n", "4 0.1 3348644 NSE National Stock Exchange of India \n", "\n", " country is_etf actively_trading \n", "0 IN False True \n", "1 IN False True \n", "2 IN False True \n", "3 IN False True \n", "4 IN False True " ] }, "execution_count": 20, "metadata": {}, "output_type": "execute_result" } ], "source": [ "industry_results = obb.equity.screener(country=\"IN\", industry=\"manufacturing\").to_df()\n", "display(len(industry_results))\n", "industry_results.head(5).convert_dtypes()\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "### Search by Exchange\n", "\n", "Some countries, like America, have multiple exchanges. Narrow the search by combining two or more parameters. The example below finds the companies listed on the American Stock Exchange (AMEX) that are domiciled in China." ] }, { "cell_type": "code", "execution_count": 22, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "4" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
symbolnamemarket_capsectorindustrybetapricevolumeexchangeexchange_namecountryis_etfactively_trading
0AMBOAmbow Education Holding Ltd.4314134Consumer DefensiveEducation & Training Services0.4480.152154634AMEXAmerican Stock ExchangeCNFalseTrue
1ITPIT Tech Packaging, Inc.2922131Basic MaterialsPaper & Paper Products-0.10.290317827AMEXAmerican Stock ExchangeCNFalseTrue
2DXFDunxin Financial Holdings Limited1232011Financial ServicesCredit Services1.6320.31259614AMEXAmerican Stock ExchangeCNFalseTrue
3CPHIChina Pharma Holdings, Inc.1084973HealthcareDrug Manufacturers—Specialty & Generic0.8750.0949483393AMEXAmerican Stock ExchangeCNFalseTrue
\n", "
" ], "text/plain": [ " symbol name market_cap sector \\\n", "0 AMBO Ambow Education Holding Ltd. 4314134 Consumer Defensive \n", "1 ITP IT Tech Packaging, Inc. 2922131 Basic Materials \n", "2 DXF Dunxin Financial Holdings Limited 1232011 Financial Services \n", "3 CPHI China Pharma Holdings, Inc. 1084973 Healthcare \n", "\n", " industry beta price volume exchange \\\n", "0 Education & Training Services 0.448 0.1521 54634 AMEX \n", "1 Paper & Paper Products -0.1 0.2903 17827 AMEX \n", "2 Credit Services 1.632 0.31 259614 AMEX \n", "3 Drug Manufacturers—Specialty & Generic 0.875 0.0949 483393 AMEX \n", "\n", " exchange_name country is_etf actively_trading \n", "0 American Stock Exchange CN False True \n", "1 American Stock Exchange CN False True \n", "2 American Stock Exchange CN False True \n", "3 American Stock Exchange CN False True " ] }, "execution_count": 22, "metadata": {}, "output_type": "execute_result" } ], "source": [ "exchange_results = obb.equity.screener(exchange=\"amex\", country=\"CN\").to_df()\n", "display(len(exchange_results))\n", "exchange_results.convert_dtypes()\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Find an Index\n", "\n", "List all indices from a source with:" ] }, { "cell_type": "code", "execution_count": 23, "metadata": {}, "outputs": [ { "data": { "text/plain": [ "274" ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "indices = obb.index.available(provider=\"yfinance\").to_df()\n", "display(len(indices))\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Filter the list down by querying the DataFrame." ] }, { "cell_type": "code", "execution_count": 24, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
namecodesymbol
88S&P/ASX 200 Index (AUD)au_asx200^AXJO
90S&P/ASX 200 Energy Sector Index (AUD)au_energy^AXEJ
91S&P/ASX 200 Resources Sector Index (AUD)au_resources^AXJR
92S&P/ASX 200 Materials Sector Index (AUD)au_materials^AXMJ
94S&P/ASX 200 Industrials Sector Index (AUD)au_industrials^AXNJ
95S&P/ASX 200 Consumer Discretionary Sector Inde...au_discretionary^AXDJ
96S&P/ASX 200 Consumer Staples Sector Index (AUD)au_staples^AXSJ
97S&P/ASX 200 Health Care Sector Index (AUD)au_health^AXHJ
98S&P/ASX 200 Financials Sector Index (AUD)au_financials^AXFJ
99S&P/ASX 200 A-REIT Industry Index (AUD)au_reit^AXPJ
100S&P/ASX 200 Info Tech Sector Index (AUD)au_tech^AXIJ
101S&P/ASX 200 Communications Sector Index (AUD)au_communications^AXTJ
102S&P/ASX 200 Utilities Sector Index (AUD)au_utilities^AXUJ
\n", "
" ], "text/plain": [ " name code \\\n", "88 S&P/ASX 200 Index (AUD) au_asx200 \n", "90 S&P/ASX 200 Energy Sector Index (AUD) au_energy \n", "91 S&P/ASX 200 Resources Sector Index (AUD) au_resources \n", "92 S&P/ASX 200 Materials Sector Index (AUD) au_materials \n", "94 S&P/ASX 200 Industrials Sector Index (AUD) au_industrials \n", "95 S&P/ASX 200 Consumer Discretionary Sector Inde... au_discretionary \n", "96 S&P/ASX 200 Consumer Staples Sector Index (AUD) au_staples \n", "97 S&P/ASX 200 Health Care Sector Index (AUD) au_health \n", "98 S&P/ASX 200 Financials Sector Index (AUD) au_financials \n", "99 S&P/ASX 200 A-REIT Industry Index (AUD) au_reit \n", "100 S&P/ASX 200 Info Tech Sector Index (AUD) au_tech \n", "101 S&P/ASX 200 Communications Sector Index (AUD) au_communications \n", "102 S&P/ASX 200 Utilities Sector Index (AUD) au_utilities \n", "\n", " symbol \n", "88 ^AXJO \n", "90 ^AXEJ \n", "91 ^AXJR \n", "92 ^AXMJ \n", "94 ^AXNJ \n", "95 ^AXDJ \n", "96 ^AXSJ \n", "97 ^AXHJ \n", "98 ^AXFJ \n", "99 ^AXPJ \n", "100 ^AXIJ \n", "101 ^AXTJ \n", "102 ^AXUJ " ] }, "execution_count": 24, "metadata": {}, "output_type": "execute_result" } ], "source": [ "indices[indices[\"name\"].str.contains(\"ASX 200\")]\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "With the `openbb-yfinance` extension, index time series can be loaded using the ticker symbol or short code. Non-American indices have a code beginning with the two-letter country code." ] }, { "cell_type": "code", "execution_count": 25, "metadata": {}, "outputs": [ { "data": { "text/html": [ "
\n", "\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
openhighlowclosevolume
date
2023-11-17TrueTrueTrueTrueTrue
\n", "
" ], "text/plain": [ " open high low close volume\n", "date \n", "2023-11-17 True True True True True" ] }, "execution_count": 25, "metadata": {}, "output_type": "execute_result" } ], "source": [ "(\n", " obb.index.market(\"au_utilities\", provider=\"yfinance\").to_df().tail(1)\n", " == obb.index.market(\"^AXUJ\", provider=\"yfinance\").to_df().tail(1)\n", ")\n" ] } ], "metadata": { "kernelspec": { "display_name": "obb-sdk4", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.11.4" } }, "nbformat": 4, "nbformat_minor": 2 }