mirror of
https://github.com/OpenBB-finance/OpenBB.git
synced 2026-06-06 20:56:27 +08:00
2253 lines
78 KiB
Plaintext
Vendored
2253 lines
78 KiB
Plaintext
Vendored
{
|
||
"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 is with a basic text query.\n",
|
||
"\n",
|
||
"## Search Nasdaq"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"execution_count": 2,
|
||
"metadata": {},
|
||
"outputs": [
|
||
{
|
||
"data": {
|
||
"text/html": [
|
||
"<div>\n",
|
||
"<style scoped>\n",
|
||
" .dataframe tbody tr th:only-of-type {\n",
|
||
" vertical-align: middle;\n",
|
||
" }\n",
|
||
"\n",
|
||
" .dataframe tbody tr th {\n",
|
||
" vertical-align: top;\n",
|
||
" }\n",
|
||
"\n",
|
||
" .dataframe thead th {\n",
|
||
" text-align: right;\n",
|
||
" }\n",
|
||
"</style>\n",
|
||
"<table border=\"1\" class=\"dataframe\">\n",
|
||
" <thead>\n",
|
||
" <tr style=\"text-align: right;\">\n",
|
||
" <th></th>\n",
|
||
" <th>symbol</th>\n",
|
||
" <th>name</th>\n",
|
||
" <th>nasdaq_traded</th>\n",
|
||
" <th>exchange</th>\n",
|
||
" <th>market_category</th>\n",
|
||
" <th>etf</th>\n",
|
||
" <th>round_lot_size</th>\n",
|
||
" <th>test_issue</th>\n",
|
||
" <th>financial_status</th>\n",
|
||
" <th>cqs_symbol</th>\n",
|
||
" <th>nasdaq_symbol</th>\n",
|
||
" <th>next_shares</th>\n",
|
||
" </tr>\n",
|
||
" </thead>\n",
|
||
" <tbody>\n",
|
||
" <tr>\n",
|
||
" <th>0</th>\n",
|
||
" <td>AMJ</td>\n",
|
||
" <td>JPMorgan Chase Capital XVI JP Morgan Alerian M...</td>\n",
|
||
" <td>Y</td>\n",
|
||
" <td>P</td>\n",
|
||
" <td>None</td>\n",
|
||
" <td>N</td>\n",
|
||
" <td>100.0</td>\n",
|
||
" <td>N</td>\n",
|
||
" <td>None</td>\n",
|
||
" <td>AMJ</td>\n",
|
||
" <td>AMJ</td>\n",
|
||
" <td>N</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>1</th>\n",
|
||
" <td>AMJB</td>\n",
|
||
" <td>JPMorgan Chase & Co. Alerian MLP Index ETNs du...</td>\n",
|
||
" <td>Y</td>\n",
|
||
" <td>P</td>\n",
|
||
" <td>None</td>\n",
|
||
" <td>Y</td>\n",
|
||
" <td>100.0</td>\n",
|
||
" <td>N</td>\n",
|
||
" <td>None</td>\n",
|
||
" <td>AMJB</td>\n",
|
||
" <td>AMJB</td>\n",
|
||
" <td>N</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>2</th>\n",
|
||
" <td>BBAG</td>\n",
|
||
" <td>JPMorgan BetaBuilders U.S. Aggregate Bond ETF</td>\n",
|
||
" <td>Y</td>\n",
|
||
" <td>P</td>\n",
|
||
" <td>None</td>\n",
|
||
" <td>Y</td>\n",
|
||
" <td>100.0</td>\n",
|
||
" <td>N</td>\n",
|
||
" <td>None</td>\n",
|
||
" <td>BBAG</td>\n",
|
||
" <td>BBAG</td>\n",
|
||
" <td>N</td>\n",
|
||
" </tr>\n",
|
||
" </tbody>\n",
|
||
"</table>\n",
|
||
"</div>"
|
||
],
|
||
"text/plain": [
|
||
" symbol name nasdaq_traded \\\n",
|
||
"0 AMJ JPMorgan Chase Capital XVI JP Morgan Alerian M... Y \n",
|
||
"1 AMJB JPMorgan Chase & Co. Alerian MLP Index ETNs du... Y \n",
|
||
"2 BBAG JPMorgan BetaBuilders U.S. Aggregate Bond ETF Y \n",
|
||
"\n",
|
||
" exchange market_category etf round_lot_size test_issue financial_status \\\n",
|
||
"0 P None N 100.0 N None \n",
|
||
"1 P None Y 100.0 N None \n",
|
||
"2 P None Y 100.0 N None \n",
|
||
"\n",
|
||
" cqs_symbol nasdaq_symbol next_shares \n",
|
||
"0 AMJ AMJ N \n",
|
||
"1 AMJB AMJB N \n",
|
||
"2 BBAG BBAG N "
|
||
]
|
||
},
|
||
"execution_count": 2,
|
||
"metadata": {},
|
||
"output_type": "execute_result"
|
||
}
|
||
],
|
||
"source": [
|
||
"obb.equity.search(\"JPMorgan\", provider=\"nasdaq\").to_df().head(3)"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "markdown",
|
||
"metadata": {},
|
||
"source": [
|
||
"## Search Cboe"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"execution_count": 3,
|
||
"metadata": {},
|
||
"outputs": [
|
||
{
|
||
"data": {
|
||
"text/html": [
|
||
"<div>\n",
|
||
"<style scoped>\n",
|
||
" .dataframe tbody tr th:only-of-type {\n",
|
||
" vertical-align: middle;\n",
|
||
" }\n",
|
||
"\n",
|
||
" .dataframe tbody tr th {\n",
|
||
" vertical-align: top;\n",
|
||
" }\n",
|
||
"\n",
|
||
" .dataframe thead th {\n",
|
||
" text-align: right;\n",
|
||
" }\n",
|
||
"</style>\n",
|
||
"<table border=\"1\" class=\"dataframe\">\n",
|
||
" <thead>\n",
|
||
" <tr style=\"text-align: right;\">\n",
|
||
" <th></th>\n",
|
||
" <th>symbol</th>\n",
|
||
" <th>name</th>\n",
|
||
" <th>description</th>\n",
|
||
" <th>data_delay</th>\n",
|
||
" <th>currency</th>\n",
|
||
" <th>time_zone</th>\n",
|
||
" <th>open_time</th>\n",
|
||
" <th>close_time</th>\n",
|
||
" <th>tick_days</th>\n",
|
||
" <th>tick_frequency</th>\n",
|
||
" <th>tick_period</th>\n",
|
||
" </tr>\n",
|
||
" </thead>\n",
|
||
" <tbody>\n",
|
||
" <tr>\n",
|
||
" <th>32</th>\n",
|
||
" <td>SPXVIV</td>\n",
|
||
" <td>PROSHARES S&P 500 EX-HEALTH CARE ETF</td>\n",
|
||
" <td>PROSHARES S&P 500 EX-HEALTH CARE ETF</td>\n",
|
||
" <td>15</td>\n",
|
||
" <td>USD</td>\n",
|
||
" <td>America/Chicago</td>\n",
|
||
" <td>08:00:00</td>\n",
|
||
" <td>16:00:00</td>\n",
|
||
" <td>MonToFri</td>\n",
|
||
" <td>C</td>\n",
|
||
" <td>Regular</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>33</th>\n",
|
||
" <td>VIX1D</td>\n",
|
||
" <td>Cboe 1-Day Volatility Index®</td>\n",
|
||
" <td>Estimates expected volatility by aggregating t...</td>\n",
|
||
" <td>15</td>\n",
|
||
" <td>USD</td>\n",
|
||
" <td>America/Chicago</td>\n",
|
||
" <td>08:00:00</td>\n",
|
||
" <td>16:00:00</td>\n",
|
||
" <td>MonToFri</td>\n",
|
||
" <td>C</td>\n",
|
||
" <td>Regular</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>34</th>\n",
|
||
" <td>VIX3M</td>\n",
|
||
" <td>Cboe S&P 500 3 Month Volatility Index</td>\n",
|
||
" <td>The Cboe 3-Month Volatility Index (VIX3M) is d...</td>\n",
|
||
" <td>15</td>\n",
|
||
" <td>USD</td>\n",
|
||
" <td>America/Chicago</td>\n",
|
||
" <td>08:00:00</td>\n",
|
||
" <td>16:00:00</td>\n",
|
||
" <td>MonToFri</td>\n",
|
||
" <td>C</td>\n",
|
||
" <td>Regular</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>35</th>\n",
|
||
" <td>WPUT</td>\n",
|
||
" <td>Cboe S&P 500 One-Week PutWrite Index</td>\n",
|
||
" <td>Tracks the value of a portfolio that overlays ...</td>\n",
|
||
" <td>15</td>\n",
|
||
" <td>USD</td>\n",
|
||
" <td>America/Chicago</td>\n",
|
||
" <td>08:00:00</td>\n",
|
||
" <td>16:00:00</td>\n",
|
||
" <td>MonToFri</td>\n",
|
||
" <td>C</td>\n",
|
||
" <td>Regular</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>36</th>\n",
|
||
" <td>XSPAM</td>\n",
|
||
" <td>Mini SPX Index (AM Settlement)</td>\n",
|
||
" <td>Mini SPX Index (AM Settlement)</td>\n",
|
||
" <td>15</td>\n",
|
||
" <td>USD</td>\n",
|
||
" <td>America/Chicago</td>\n",
|
||
" <td>08:00:00</td>\n",
|
||
" <td>16:00:00</td>\n",
|
||
" <td>MonToFri</td>\n",
|
||
" <td>C</td>\n",
|
||
" <td>Regular</td>\n",
|
||
" </tr>\n",
|
||
" </tbody>\n",
|
||
"</table>\n",
|
||
"</div>"
|
||
],
|
||
"text/plain": [
|
||
" symbol name \\\n",
|
||
"32 SPXVIV PROSHARES S&P 500 EX-HEALTH CARE ETF \n",
|
||
"33 VIX1D Cboe 1-Day Volatility Index® \n",
|
||
"34 VIX3M Cboe S&P 500 3 Month Volatility Index \n",
|
||
"35 WPUT Cboe S&P 500 One-Week PutWrite Index \n",
|
||
"36 XSPAM Mini SPX Index (AM Settlement) \n",
|
||
"\n",
|
||
" description data_delay currency \\\n",
|
||
"32 PROSHARES S&P 500 EX-HEALTH CARE ETF 15 USD \n",
|
||
"33 Estimates expected volatility by aggregating t... 15 USD \n",
|
||
"34 The Cboe 3-Month Volatility Index (VIX3M) is d... 15 USD \n",
|
||
"35 Tracks the value of a portfolio that overlays ... 15 USD \n",
|
||
"36 Mini SPX Index (AM Settlement) 15 USD \n",
|
||
"\n",
|
||
" time_zone open_time close_time tick_days tick_frequency tick_period \n",
|
||
"32 America/Chicago 08:00:00 16:00:00 MonToFri C Regular \n",
|
||
"33 America/Chicago 08:00:00 16:00:00 MonToFri C Regular \n",
|
||
"34 America/Chicago 08:00:00 16:00:00 MonToFri C Regular \n",
|
||
"35 America/Chicago 08:00:00 16:00:00 MonToFri C Regular \n",
|
||
"36 America/Chicago 08:00:00 16:00:00 MonToFri C Regular "
|
||
]
|
||
},
|
||
"execution_count": 3,
|
||
"metadata": {},
|
||
"output_type": "execute_result"
|
||
}
|
||
],
|
||
"source": [
|
||
"obb.index.search(\"SPX\", provider=\"cboe\").to_df().tail(5)"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "markdown",
|
||
"metadata": {},
|
||
"source": [
|
||
"## Search ETFs"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"execution_count": 4,
|
||
"metadata": {},
|
||
"outputs": [
|
||
{
|
||
"data": {
|
||
"text/html": [
|
||
"<div>\n",
|
||
"<style scoped>\n",
|
||
" .dataframe tbody tr th:only-of-type {\n",
|
||
" vertical-align: middle;\n",
|
||
" }\n",
|
||
"\n",
|
||
" .dataframe tbody tr th {\n",
|
||
" vertical-align: top;\n",
|
||
" }\n",
|
||
"\n",
|
||
" .dataframe thead th {\n",
|
||
" text-align: right;\n",
|
||
" }\n",
|
||
"</style>\n",
|
||
"<table border=\"1\" class=\"dataframe\">\n",
|
||
" <thead>\n",
|
||
" <tr style=\"text-align: right;\">\n",
|
||
" <th></th>\n",
|
||
" <th>symbol</th>\n",
|
||
" <th>name</th>\n",
|
||
" <th>short_name</th>\n",
|
||
" <th>inception_date</th>\n",
|
||
" <th>issuer</th>\n",
|
||
" <th>investment_style</th>\n",
|
||
" <th>esg</th>\n",
|
||
" <th>currency</th>\n",
|
||
" <th>unit_price</th>\n",
|
||
" <th>close</th>\n",
|
||
" <th>...</th>\n",
|
||
" <th>avg_volume</th>\n",
|
||
" <th>avg_volume_30d</th>\n",
|
||
" <th>aum</th>\n",
|
||
" <th>pe_ratio</th>\n",
|
||
" <th>pb_ratio</th>\n",
|
||
" <th>management_fee</th>\n",
|
||
" <th>mer</th>\n",
|
||
" <th>distribution_yield</th>\n",
|
||
" <th>dividend_frequency</th>\n",
|
||
" <th>beta_20y</th>\n",
|
||
" </tr>\n",
|
||
" </thead>\n",
|
||
" <tbody>\n",
|
||
" <tr>\n",
|
||
" <th>17</th>\n",
|
||
" <td>VALT.B</td>\n",
|
||
" <td>CI Gold Bullion Fund</td>\n",
|
||
" <td>VALT.B:CA</td>\n",
|
||
" <td>2021-03-17</td>\n",
|
||
" <td>CI Global Asset Management</td>\n",
|
||
" <td>Gold</td>\n",
|
||
" <td>False</td>\n",
|
||
" <td>CAD</td>\n",
|
||
" <td>27.23</td>\n",
|
||
" <td>27.31</td>\n",
|
||
" <td>...</td>\n",
|
||
" <td>430</td>\n",
|
||
" <td>1428</td>\n",
|
||
" <td>14976500.0</td>\n",
|
||
" <td>NaN</td>\n",
|
||
" <td>NaN</td>\n",
|
||
" <td>0.00155</td>\n",
|
||
" <td>NaN</td>\n",
|
||
" <td>0.015347</td>\n",
|
||
" <td>Annually</td>\n",
|
||
" <td>NaN</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>18</th>\n",
|
||
" <td>VALT.U</td>\n",
|
||
" <td>CI Gold Bullion Fund</td>\n",
|
||
" <td>CI Gold Bullion</td>\n",
|
||
" <td>2021-01-06</td>\n",
|
||
" <td>CI Global Asset Management</td>\n",
|
||
" <td>Gold</td>\n",
|
||
" <td>False</td>\n",
|
||
" <td>USD</td>\n",
|
||
" <td>20.25</td>\n",
|
||
" <td>20.22</td>\n",
|
||
" <td>...</td>\n",
|
||
" <td>690</td>\n",
|
||
" <td>4747</td>\n",
|
||
" <td>28147500.0</td>\n",
|
||
" <td>NaN</td>\n",
|
||
" <td>NaN</td>\n",
|
||
" <td>0.00155</td>\n",
|
||
" <td>NaN</td>\n",
|
||
" <td>0.016145</td>\n",
|
||
" <td>Annually</td>\n",
|
||
" <td>NaN</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>19</th>\n",
|
||
" <td>XGD</td>\n",
|
||
" <td>iShares S&P/TSX Global Gold Index ETF</td>\n",
|
||
" <td>iShares S&P/TSX</td>\n",
|
||
" <td>2001-03-23</td>\n",
|
||
" <td>RBC iShares</td>\n",
|
||
" <td>Mid Cap Growth</td>\n",
|
||
" <td>False</td>\n",
|
||
" <td>CAD</td>\n",
|
||
" <td>15.15</td>\n",
|
||
" <td>15.15</td>\n",
|
||
" <td>...</td>\n",
|
||
" <td>456399</td>\n",
|
||
" <td>1194453</td>\n",
|
||
" <td>986265000.0</td>\n",
|
||
" <td>26.4436</td>\n",
|
||
" <td>1.9090</td>\n",
|
||
" <td>0.00610</td>\n",
|
||
" <td>0.0061</td>\n",
|
||
" <td>0.016213</td>\n",
|
||
" <td>Semi-Annually</td>\n",
|
||
" <td>0.560996</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>20</th>\n",
|
||
" <td>ZGD</td>\n",
|
||
" <td>BMO Equal Weight Global Gold Index ETF</td>\n",
|
||
" <td>BMO Equal Weight</td>\n",
|
||
" <td>2012-11-14</td>\n",
|
||
" <td>BMO ETF</td>\n",
|
||
" <td>Mid Cap Blend</td>\n",
|
||
" <td>False</td>\n",
|
||
" <td>CAD</td>\n",
|
||
" <td>65.30</td>\n",
|
||
" <td>63.90</td>\n",
|
||
" <td>...</td>\n",
|
||
" <td>436</td>\n",
|
||
" <td>3417</td>\n",
|
||
" <td>41396935.0</td>\n",
|
||
" <td>17.2285</td>\n",
|
||
" <td>1.3891</td>\n",
|
||
" <td>0.00550</td>\n",
|
||
" <td>0.0062</td>\n",
|
||
" <td>0.008305</td>\n",
|
||
" <td>Annually</td>\n",
|
||
" <td>NaN</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>21</th>\n",
|
||
" <td>ZJG</td>\n",
|
||
" <td>BMO Junior Gold Index ETF</td>\n",
|
||
" <td>BMO Junior Gold</td>\n",
|
||
" <td>2010-01-19</td>\n",
|
||
" <td>BMO ETF</td>\n",
|
||
" <td>Small Cap Blend</td>\n",
|
||
" <td>True</td>\n",
|
||
" <td>CAD</td>\n",
|
||
" <td>57.90</td>\n",
|
||
" <td>58.10</td>\n",
|
||
" <td>...</td>\n",
|
||
" <td>511</td>\n",
|
||
" <td>1491</td>\n",
|
||
" <td>52271541.0</td>\n",
|
||
" <td>26.8283</td>\n",
|
||
" <td>1.5310</td>\n",
|
||
" <td>0.00550</td>\n",
|
||
" <td>0.0061</td>\n",
|
||
" <td>0.009537</td>\n",
|
||
" <td>Annually</td>\n",
|
||
" <td>NaN</td>\n",
|
||
" </tr>\n",
|
||
" </tbody>\n",
|
||
"</table>\n",
|
||
"<p>5 rows × 35 columns</p>\n",
|
||
"</div>"
|
||
],
|
||
"text/plain": [
|
||
" symbol name short_name \\\n",
|
||
"17 VALT.B CI Gold Bullion Fund VALT.B:CA \n",
|
||
"18 VALT.U CI Gold Bullion Fund CI Gold Bullion \n",
|
||
"19 XGD iShares S&P/TSX Global Gold Index ETF iShares S&P/TSX \n",
|
||
"20 ZGD BMO Equal Weight Global Gold Index ETF BMO Equal Weight \n",
|
||
"21 ZJG BMO Junior Gold Index ETF BMO Junior Gold \n",
|
||
"\n",
|
||
" inception_date issuer investment_style esg \\\n",
|
||
"17 2021-03-17 CI Global Asset Management Gold False \n",
|
||
"18 2021-01-06 CI Global Asset Management Gold False \n",
|
||
"19 2001-03-23 RBC iShares Mid Cap Growth False \n",
|
||
"20 2012-11-14 BMO ETF Mid Cap Blend False \n",
|
||
"21 2010-01-19 BMO ETF Small Cap Blend True \n",
|
||
"\n",
|
||
" currency unit_price close ... avg_volume avg_volume_30d aum \\\n",
|
||
"17 CAD 27.23 27.31 ... 430 1428 14976500.0 \n",
|
||
"18 USD 20.25 20.22 ... 690 4747 28147500.0 \n",
|
||
"19 CAD 15.15 15.15 ... 456399 1194453 986265000.0 \n",
|
||
"20 CAD 65.30 63.90 ... 436 3417 41396935.0 \n",
|
||
"21 CAD 57.90 58.10 ... 511 1491 52271541.0 \n",
|
||
"\n",
|
||
" pe_ratio pb_ratio management_fee mer distribution_yield \\\n",
|
||
"17 NaN NaN 0.00155 NaN 0.015347 \n",
|
||
"18 NaN NaN 0.00155 NaN 0.016145 \n",
|
||
"19 26.4436 1.9090 0.00610 0.0061 0.016213 \n",
|
||
"20 17.2285 1.3891 0.00550 0.0062 0.008305 \n",
|
||
"21 26.8283 1.5310 0.00550 0.0061 0.009537 \n",
|
||
"\n",
|
||
" dividend_frequency beta_20y \n",
|
||
"17 Annually NaN \n",
|
||
"18 Annually NaN \n",
|
||
"19 Semi-Annually 0.560996 \n",
|
||
"20 Annually NaN \n",
|
||
"21 Annually NaN \n",
|
||
"\n",
|
||
"[5 rows x 35 columns]"
|
||
]
|
||
},
|
||
"execution_count": 4,
|
||
"metadata": {},
|
||
"output_type": "execute_result"
|
||
}
|
||
],
|
||
"source": [
|
||
"obb.etf.search(\"gold\", provider=\"tmx\").to_df().iloc[-5:]"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"execution_count": 5,
|
||
"metadata": {},
|
||
"outputs": [
|
||
{
|
||
"data": {
|
||
"text/html": [
|
||
"<div>\n",
|
||
"<style scoped>\n",
|
||
" .dataframe tbody tr th:only-of-type {\n",
|
||
" vertical-align: middle;\n",
|
||
" }\n",
|
||
"\n",
|
||
" .dataframe tbody tr th {\n",
|
||
" vertical-align: top;\n",
|
||
" }\n",
|
||
"\n",
|
||
" .dataframe thead th {\n",
|
||
" text-align: right;\n",
|
||
" }\n",
|
||
"</style>\n",
|
||
"<table border=\"1\" class=\"dataframe\">\n",
|
||
" <thead>\n",
|
||
" <tr style=\"text-align: right;\">\n",
|
||
" <th></th>\n",
|
||
" <th>symbol</th>\n",
|
||
" <th>name</th>\n",
|
||
" <th>market_cap</th>\n",
|
||
" <th>sector</th>\n",
|
||
" <th>industry</th>\n",
|
||
" <th>beta</th>\n",
|
||
" <th>price</th>\n",
|
||
" <th>last_annual_dividend</th>\n",
|
||
" <th>volume</th>\n",
|
||
" <th>exchange</th>\n",
|
||
" <th>exchange_name</th>\n",
|
||
" <th>country</th>\n",
|
||
" <th>actively_trading</th>\n",
|
||
" <th>isFund</th>\n",
|
||
" </tr>\n",
|
||
" </thead>\n",
|
||
" <tbody>\n",
|
||
" <tr>\n",
|
||
" <th>0</th>\n",
|
||
" <td>QYLD</td>\n",
|
||
" <td>Global X NASDAQ 100 Covered Call ETF</td>\n",
|
||
" <td>7.851962e+09</td>\n",
|
||
" <td></td>\n",
|
||
" <td>None</td>\n",
|
||
" <td>0.65</td>\n",
|
||
" <td>17.8200</td>\n",
|
||
" <td>2.06171</td>\n",
|
||
" <td>1216103.0</td>\n",
|
||
" <td>NASDAQ</td>\n",
|
||
" <td>NASDAQ Global Market</td>\n",
|
||
" <td>US</td>\n",
|
||
" <td>True</td>\n",
|
||
" <td>False</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>1</th>\n",
|
||
" <td>XYLD</td>\n",
|
||
" <td>Global X S&P 500 Covered Call ETF</td>\n",
|
||
" <td>2.750881e+09</td>\n",
|
||
" <td></td>\n",
|
||
" <td>None</td>\n",
|
||
" <td>0.53</td>\n",
|
||
" <td>40.0998</td>\n",
|
||
" <td>3.94248</td>\n",
|
||
" <td>64645.0</td>\n",
|
||
" <td>AMEX</td>\n",
|
||
" <td>New York Stock Exchange Arca</td>\n",
|
||
" <td>US</td>\n",
|
||
" <td>True</td>\n",
|
||
" <td>False</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>2</th>\n",
|
||
" <td>ZWU.TO</td>\n",
|
||
" <td>BMO Covered Call Utilities ETF</td>\n",
|
||
" <td>1.698515e+09</td>\n",
|
||
" <td></td>\n",
|
||
" <td>None</td>\n",
|
||
" <td>0.67</td>\n",
|
||
" <td>10.0300</td>\n",
|
||
" <td>0.86000</td>\n",
|
||
" <td>56572.0</td>\n",
|
||
" <td>TSX</td>\n",
|
||
" <td>Toronto Stock Exchange</td>\n",
|
||
" <td>CA</td>\n",
|
||
" <td>True</td>\n",
|
||
" <td>False</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>3</th>\n",
|
||
" <td>ZWC.TO</td>\n",
|
||
" <td>BMO CA High Dividend Covered Call ETF</td>\n",
|
||
" <td>1.602642e+09</td>\n",
|
||
" <td></td>\n",
|
||
" <td>None</td>\n",
|
||
" <td>0.89</td>\n",
|
||
" <td>17.0200</td>\n",
|
||
" <td>1.19000</td>\n",
|
||
" <td>17235.0</td>\n",
|
||
" <td>TSX</td>\n",
|
||
" <td>Toronto Stock Exchange</td>\n",
|
||
" <td>CA</td>\n",
|
||
" <td>True</td>\n",
|
||
" <td>False</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>4</th>\n",
|
||
" <td>RYLD</td>\n",
|
||
" <td>Global X Russell 2000 Covered Call ETF</td>\n",
|
||
" <td>1.406859e+09</td>\n",
|
||
" <td>Miscellaneous</td>\n",
|
||
" <td>Investment Trusts/Mutual Funds</td>\n",
|
||
" <td>0.56</td>\n",
|
||
" <td>16.4900</td>\n",
|
||
" <td>1.87702</td>\n",
|
||
" <td>133691.0</td>\n",
|
||
" <td>AMEX</td>\n",
|
||
" <td>New York Stock Exchange Arca</td>\n",
|
||
" <td>US</td>\n",
|
||
" <td>True</td>\n",
|
||
" <td>False</td>\n",
|
||
" </tr>\n",
|
||
" </tbody>\n",
|
||
"</table>\n",
|
||
"</div>"
|
||
],
|
||
"text/plain": [
|
||
" symbol name market_cap \\\n",
|
||
"0 QYLD Global X NASDAQ 100 Covered Call ETF 7.851962e+09 \n",
|
||
"1 XYLD Global X S&P 500 Covered Call ETF 2.750881e+09 \n",
|
||
"2 ZWU.TO BMO Covered Call Utilities ETF 1.698515e+09 \n",
|
||
"3 ZWC.TO BMO CA High Dividend Covered Call ETF 1.602642e+09 \n",
|
||
"4 RYLD Global X Russell 2000 Covered Call ETF 1.406859e+09 \n",
|
||
"\n",
|
||
" sector industry beta price \\\n",
|
||
"0 None 0.65 17.8200 \n",
|
||
"1 None 0.53 40.0998 \n",
|
||
"2 None 0.67 10.0300 \n",
|
||
"3 None 0.89 17.0200 \n",
|
||
"4 Miscellaneous Investment Trusts/Mutual Funds 0.56 16.4900 \n",
|
||
"\n",
|
||
" last_annual_dividend volume exchange exchange_name \\\n",
|
||
"0 2.06171 1216103.0 NASDAQ NASDAQ Global Market \n",
|
||
"1 3.94248 64645.0 AMEX New York Stock Exchange Arca \n",
|
||
"2 0.86000 56572.0 TSX Toronto Stock Exchange \n",
|
||
"3 1.19000 17235.0 TSX Toronto Stock Exchange \n",
|
||
"4 1.87702 133691.0 AMEX New York Stock Exchange Arca \n",
|
||
"\n",
|
||
" country actively_trading isFund \n",
|
||
"0 US True False \n",
|
||
"1 US True False \n",
|
||
"2 CA True False \n",
|
||
"3 CA True False \n",
|
||
"4 US True False "
|
||
]
|
||
},
|
||
"execution_count": 5,
|
||
"metadata": {},
|
||
"output_type": "execute_result"
|
||
}
|
||
],
|
||
"source": [
|
||
"obb.etf.search(\"covered call\", provider=\"fmp\").to_df().iloc[:5]"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "markdown",
|
||
"metadata": {},
|
||
"source": [
|
||
"## Search the SEC\n",
|
||
"\n",
|
||
"Use an empty string, `\"\"`, to return the complete list - over 10,000.\n",
|
||
"\n",
|
||
"The SEC sorts this list by market cap. Applying the `to_df()` method to `all_companies` will show them from biggest-to-smallest."
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"execution_count": 8,
|
||
"metadata": {},
|
||
"outputs": [
|
||
{
|
||
"name": "stdout",
|
||
"output_type": "stream",
|
||
"text": [
|
||
"10551\n"
|
||
]
|
||
},
|
||
{
|
||
"data": {
|
||
"text/html": [
|
||
"<div>\n",
|
||
"<style scoped>\n",
|
||
" .dataframe tbody tr th:only-of-type {\n",
|
||
" vertical-align: middle;\n",
|
||
" }\n",
|
||
"\n",
|
||
" .dataframe tbody tr th {\n",
|
||
" vertical-align: top;\n",
|
||
" }\n",
|
||
"\n",
|
||
" .dataframe thead th {\n",
|
||
" text-align: right;\n",
|
||
" }\n",
|
||
"</style>\n",
|
||
"<table border=\"1\" class=\"dataframe\">\n",
|
||
" <thead>\n",
|
||
" <tr style=\"text-align: right;\">\n",
|
||
" <th></th>\n",
|
||
" <th>symbol</th>\n",
|
||
" <th>name</th>\n",
|
||
" <th>cik</th>\n",
|
||
" </tr>\n",
|
||
" </thead>\n",
|
||
" <tbody>\n",
|
||
" <tr>\n",
|
||
" <th>0</th>\n",
|
||
" <td>MSFT</td>\n",
|
||
" <td>MICROSOFT CORP</td>\n",
|
||
" <td>789019</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>1</th>\n",
|
||
" <td>AAPL</td>\n",
|
||
" <td>Apple Inc.</td>\n",
|
||
" <td>320193</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>2</th>\n",
|
||
" <td>GOOGL</td>\n",
|
||
" <td>Alphabet Inc.</td>\n",
|
||
" <td>1652044</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>3</th>\n",
|
||
" <td>NVDA</td>\n",
|
||
" <td>NVIDIA CORP</td>\n",
|
||
" <td>1045810</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>4</th>\n",
|
||
" <td>AMZN</td>\n",
|
||
" <td>AMAZON COM INC</td>\n",
|
||
" <td>1018724</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>5</th>\n",
|
||
" <td>META</td>\n",
|
||
" <td>Meta Platforms, Inc.</td>\n",
|
||
" <td>1326801</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>6</th>\n",
|
||
" <td>BRK-B</td>\n",
|
||
" <td>BERKSHIRE HATHAWAY INC</td>\n",
|
||
" <td>1067983</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>7</th>\n",
|
||
" <td>LLY</td>\n",
|
||
" <td>ELI LILLY & Co</td>\n",
|
||
" <td>59478</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>8</th>\n",
|
||
" <td>TSM</td>\n",
|
||
" <td>TAIWAN SEMICONDUCTOR MANUFACTURING CO LTD</td>\n",
|
||
" <td>1046179</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>9</th>\n",
|
||
" <td>AVGO</td>\n",
|
||
" <td>Broadcom Inc.</td>\n",
|
||
" <td>1730168</td>\n",
|
||
" </tr>\n",
|
||
" </tbody>\n",
|
||
"</table>\n",
|
||
"</div>"
|
||
],
|
||
"text/plain": [
|
||
" symbol name cik\n",
|
||
"0 MSFT MICROSOFT CORP 789019\n",
|
||
"1 AAPL Apple Inc. 320193\n",
|
||
"2 GOOGL Alphabet Inc. 1652044\n",
|
||
"3 NVDA NVIDIA CORP 1045810\n",
|
||
"4 AMZN AMAZON COM INC 1018724\n",
|
||
"5 META Meta Platforms, Inc. 1326801\n",
|
||
"6 BRK-B BERKSHIRE HATHAWAY INC 1067983\n",
|
||
"7 LLY ELI LILLY & Co 59478\n",
|
||
"8 TSM TAIWAN SEMICONDUCTOR MANUFACTURING CO LTD 1046179\n",
|
||
"9 AVGO Broadcom Inc. 1730168"
|
||
]
|
||
},
|
||
"execution_count": 8,
|
||
"metadata": {},
|
||
"output_type": "execute_result"
|
||
}
|
||
],
|
||
"source": [
|
||
"all_companies = obb.equity.search(\"\", provider=\"sec\")\n",
|
||
"\n",
|
||
"print(len(all_companies.results))\n",
|
||
"\n",
|
||
"all_companies.to_df().head(10)"
|
||
]
|
||
},
|
||
{
|
||
"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": 9,
|
||
"metadata": {},
|
||
"outputs": [
|
||
{
|
||
"data": {
|
||
"text/html": [
|
||
"<div>\n",
|
||
"<style scoped>\n",
|
||
" .dataframe tbody tr th:only-of-type {\n",
|
||
" vertical-align: middle;\n",
|
||
" }\n",
|
||
"\n",
|
||
" .dataframe tbody tr th {\n",
|
||
" vertical-align: top;\n",
|
||
" }\n",
|
||
"\n",
|
||
" .dataframe thead th {\n",
|
||
" text-align: right;\n",
|
||
" }\n",
|
||
"</style>\n",
|
||
"<table border=\"1\" class=\"dataframe\">\n",
|
||
" <thead>\n",
|
||
" <tr style=\"text-align: right;\">\n",
|
||
" <th></th>\n",
|
||
" <th>name</th>\n",
|
||
" <th>cik</th>\n",
|
||
" </tr>\n",
|
||
" </thead>\n",
|
||
" <tbody>\n",
|
||
" <tr>\n",
|
||
" <th>0</th>\n",
|
||
" <td>BERKSHIRE HATHAWAY ENERGY CO</td>\n",
|
||
" <td>0001081316</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>1</th>\n",
|
||
" <td>BERKSHIRE HATHAWAY FINANCE CORP</td>\n",
|
||
" <td>0001274791</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>2</th>\n",
|
||
" <td>BERKSHIRE HATHAWAY HOMESTATE INSURANCE CO.</td>\n",
|
||
" <td>0000829771</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>3</th>\n",
|
||
" <td>BERKSHIRE HATHAWAY INC /DE/</td>\n",
|
||
" <td>0000109694</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>4</th>\n",
|
||
" <td>BERKSHIRE HATHAWAY INC/DE</td>\n",
|
||
" <td>0000109694</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>5</th>\n",
|
||
" <td>BERKSHIRE HATHAWAY INC</td>\n",
|
||
" <td>0001067983</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>6</th>\n",
|
||
" <td>BERKSHIRE HATHAWAY LIFE INSURANCE CO OF NEBRASKA</td>\n",
|
||
" <td>0001015867</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>7</th>\n",
|
||
" <td>LMZ & BERKSHIRE HATHAWAY CO</td>\n",
|
||
" <td>0001652795</td>\n",
|
||
" </tr>\n",
|
||
" </tbody>\n",
|
||
"</table>\n",
|
||
"</div>"
|
||
],
|
||
"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": 9,
|
||
"metadata": {},
|
||
"output_type": "execute_result"
|
||
}
|
||
],
|
||
"source": [
|
||
"instututions = obb.regulators.sec.institutions_search(\"Berkshire Hathaway\").to_df()\n",
|
||
"instututions"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "markdown",
|
||
"metadata": {},
|
||
"source": [
|
||
"### Find a Filing\n",
|
||
"\n",
|
||
"Search for filings by CIK or ticker symbol."
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"execution_count": 10,
|
||
"metadata": {},
|
||
"outputs": [
|
||
{
|
||
"data": {
|
||
"text/plain": [
|
||
"filing_date 2003-02-14\n",
|
||
"accepted_date 2003-02-14 00:00:00\n",
|
||
"report_type 13F-NT\n",
|
||
"filing_url https://www.sec.gov/Archives/edgar/data/000082...\n",
|
||
"report_url https://www.sec.gov/Archives/edgar/data/000082...\n",
|
||
"report_date 2002-12-31\n",
|
||
"act \n",
|
||
"items \n",
|
||
"primary_doc_description FORM 13F-NT, PERIOD ENDED 12/31/2002\n",
|
||
"primary_doc a87269a7e13fvnt.txt\n",
|
||
"accession_number 0000950150-03-000213\n",
|
||
"file_number 028-02226\n",
|
||
"film_number 03565329\n",
|
||
"is_inline_xbrl 0\n",
|
||
"is_xbrl 0\n",
|
||
"size 4246\n",
|
||
"complete_submission_url https://www.sec.gov/Archives/edgar/data/000082...\n",
|
||
"Name: 84, dtype: object"
|
||
]
|
||
},
|
||
"execution_count": 10,
|
||
"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": 12,
|
||
"metadata": {},
|
||
"outputs": [
|
||
{
|
||
"data": {
|
||
"text/plain": [
|
||
"filing_date 2024-01-11\n",
|
||
"accepted_date 2024-01-11 00:00:00\n",
|
||
"report_type DEF 14A\n",
|
||
"filing_url https://www.sec.gov/Archives/edgar/data/000032...\n",
|
||
"report_url https://www.sec.gov/Archives/edgar/data/000032...\n",
|
||
"report_date 2024-02-28\n",
|
||
"act 34\n",
|
||
"items \n",
|
||
"primary_doc_description APPLE INC. - DEF 14A\n",
|
||
"primary_doc laapl2024_def14a.htm\n",
|
||
"accession_number 0001308179-24-000010\n",
|
||
"file_number 001-36743\n",
|
||
"film_number 24529569\n",
|
||
"is_inline_xbrl 1\n",
|
||
"is_xbrl 1\n",
|
||
"size 9051163\n",
|
||
"complete_submission_url https://www.sec.gov/Archives/edgar/data/000032...\n",
|
||
"Name: 0, dtype: object"
|
||
]
|
||
},
|
||
"execution_count": 12,
|
||
"metadata": {},
|
||
"output_type": "execute_result"
|
||
}
|
||
],
|
||
"source": [
|
||
"aapl_filings = obb.equity.fundamental.filings(\"AAPL\", type=\"4\", provider=\"sec\")\n",
|
||
"\n",
|
||
"aapl_filings.to_df().iloc[0]\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": 13,
|
||
"metadata": {},
|
||
"outputs": [
|
||
{
|
||
"data": {
|
||
"text/plain": [
|
||
"5673"
|
||
]
|
||
},
|
||
"metadata": {},
|
||
"output_type": "display_data"
|
||
},
|
||
{
|
||
"data": {
|
||
"text/html": [
|
||
"<div>\n",
|
||
"<style scoped>\n",
|
||
" .dataframe tbody tr th:only-of-type {\n",
|
||
" vertical-align: middle;\n",
|
||
" }\n",
|
||
"\n",
|
||
" .dataframe tbody tr th {\n",
|
||
" vertical-align: top;\n",
|
||
" }\n",
|
||
"\n",
|
||
" .dataframe thead th {\n",
|
||
" text-align: right;\n",
|
||
" }\n",
|
||
"</style>\n",
|
||
"<table border=\"1\" class=\"dataframe\">\n",
|
||
" <thead>\n",
|
||
" <tr style=\"text-align: right;\">\n",
|
||
" <th></th>\n",
|
||
" <th>symbol</th>\n",
|
||
" <th>name</th>\n",
|
||
" <th>market_cap</th>\n",
|
||
" <th>sector</th>\n",
|
||
" <th>industry</th>\n",
|
||
" <th>beta</th>\n",
|
||
" <th>price</th>\n",
|
||
" <th>last_annual_dividend</th>\n",
|
||
" <th>volume</th>\n",
|
||
" <th>exchange</th>\n",
|
||
" <th>exchange_name</th>\n",
|
||
" <th>country</th>\n",
|
||
" <th>is_etf</th>\n",
|
||
" <th>actively_trading</th>\n",
|
||
" <th>isFund</th>\n",
|
||
" </tr>\n",
|
||
" </thead>\n",
|
||
" <tbody>\n",
|
||
" <tr>\n",
|
||
" <th>0</th>\n",
|
||
" <td>RELIANCE.NS</td>\n",
|
||
" <td>Reliance Industries Limited</td>\n",
|
||
" <td>20104143261030</td>\n",
|
||
" <td>Energy</td>\n",
|
||
" <td>Oil & Gas Refining & Marketing</td>\n",
|
||
" <td>0.608</td>\n",
|
||
" <td>2971.3</td>\n",
|
||
" <td>9</td>\n",
|
||
" <td>5412782</td>\n",
|
||
" <td>NSE</td>\n",
|
||
" <td>National Stock Exchange of India</td>\n",
|
||
" <td>IN</td>\n",
|
||
" <td>False</td>\n",
|
||
" <td>True</td>\n",
|
||
" <td>False</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>1</th>\n",
|
||
" <td>RELIANCE.BO</td>\n",
|
||
" <td>Reliance Industries Limited</td>\n",
|
||
" <td>20098053761843</td>\n",
|
||
" <td>Energy</td>\n",
|
||
" <td>Oil & Gas Refining & Marketing</td>\n",
|
||
" <td>0.608</td>\n",
|
||
" <td>2970.4</td>\n",
|
||
" <td>9</td>\n",
|
||
" <td>83211</td>\n",
|
||
" <td>BSE</td>\n",
|
||
" <td>Bombay Stock Exchange</td>\n",
|
||
" <td>IN</td>\n",
|
||
" <td>False</td>\n",
|
||
" <td>True</td>\n",
|
||
" <td>False</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>2</th>\n",
|
||
" <td>TCS.NS</td>\n",
|
||
" <td>Tata Consultancy Services Limited</td>\n",
|
||
" <td>14850088530330</td>\n",
|
||
" <td>Technology</td>\n",
|
||
" <td>Information Technology Services</td>\n",
|
||
" <td>0.531</td>\n",
|
||
" <td>4104.4</td>\n",
|
||
" <td>51</td>\n",
|
||
" <td>2960088</td>\n",
|
||
" <td>NSE</td>\n",
|
||
" <td>National Stock Exchange of India</td>\n",
|
||
" <td>IN</td>\n",
|
||
" <td>False</td>\n",
|
||
" <td>True</td>\n",
|
||
" <td>False</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>3</th>\n",
|
||
" <td>TCS.BO</td>\n",
|
||
" <td>Tata Consultancy Services Limited</td>\n",
|
||
" <td>14844299652000</td>\n",
|
||
" <td>Technology</td>\n",
|
||
" <td>Information Technology Services</td>\n",
|
||
" <td>0.531</td>\n",
|
||
" <td>4102.8</td>\n",
|
||
" <td>51</td>\n",
|
||
" <td>334830</td>\n",
|
||
" <td>BSE</td>\n",
|
||
" <td>Bombay Stock Exchange</td>\n",
|
||
" <td>IN</td>\n",
|
||
" <td>False</td>\n",
|
||
" <td>True</td>\n",
|
||
" <td>False</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>4</th>\n",
|
||
" <td>HDFCBANK.BO</td>\n",
|
||
" <td>HDFC Bank Limited</td>\n",
|
||
" <td>10790199234483</td>\n",
|
||
" <td>Financial Services</td>\n",
|
||
" <td>Banks - Regional</td>\n",
|
||
" <td>0.79</td>\n",
|
||
" <td>1420.55</td>\n",
|
||
" <td>19</td>\n",
|
||
" <td>216503</td>\n",
|
||
" <td>BSE</td>\n",
|
||
" <td>Bombay Stock Exchange</td>\n",
|
||
" <td>IN</td>\n",
|
||
" <td>False</td>\n",
|
||
" <td>True</td>\n",
|
||
" <td>False</td>\n",
|
||
" </tr>\n",
|
||
" </tbody>\n",
|
||
"</table>\n",
|
||
"</div>"
|
||
],
|
||
"text/plain": [
|
||
" symbol name market_cap \\\n",
|
||
"0 RELIANCE.NS Reliance Industries Limited 20104143261030 \n",
|
||
"1 RELIANCE.BO Reliance Industries Limited 20098053761843 \n",
|
||
"2 TCS.NS Tata Consultancy Services Limited 14850088530330 \n",
|
||
"3 TCS.BO Tata Consultancy Services Limited 14844299652000 \n",
|
||
"4 HDFCBANK.BO HDFC Bank Limited 10790199234483 \n",
|
||
"\n",
|
||
" sector industry beta price \\\n",
|
||
"0 Energy Oil & Gas Refining & Marketing 0.608 2971.3 \n",
|
||
"1 Energy Oil & Gas Refining & Marketing 0.608 2970.4 \n",
|
||
"2 Technology Information Technology Services 0.531 4104.4 \n",
|
||
"3 Technology Information Technology Services 0.531 4102.8 \n",
|
||
"4 Financial Services Banks - Regional 0.79 1420.55 \n",
|
||
"\n",
|
||
" last_annual_dividend volume exchange exchange_name \\\n",
|
||
"0 9 5412782 NSE National Stock Exchange of India \n",
|
||
"1 9 83211 BSE Bombay Stock Exchange \n",
|
||
"2 51 2960088 NSE National Stock Exchange of India \n",
|
||
"3 51 334830 BSE Bombay Stock Exchange \n",
|
||
"4 19 216503 BSE Bombay Stock Exchange \n",
|
||
"\n",
|
||
" country is_etf actively_trading isFund \n",
|
||
"0 IN False True False \n",
|
||
"1 IN False True False \n",
|
||
"2 IN False True False \n",
|
||
"3 IN False True False \n",
|
||
"4 IN False True False "
|
||
]
|
||
},
|
||
"execution_count": 13,
|
||
"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": 14,
|
||
"metadata": {},
|
||
"outputs": [
|
||
{
|
||
"data": {
|
||
"text/plain": [
|
||
"376"
|
||
]
|
||
},
|
||
"metadata": {},
|
||
"output_type": "display_data"
|
||
},
|
||
{
|
||
"data": {
|
||
"text/html": [
|
||
"<div>\n",
|
||
"<style scoped>\n",
|
||
" .dataframe tbody tr th:only-of-type {\n",
|
||
" vertical-align: middle;\n",
|
||
" }\n",
|
||
"\n",
|
||
" .dataframe tbody tr th {\n",
|
||
" vertical-align: top;\n",
|
||
" }\n",
|
||
"\n",
|
||
" .dataframe thead th {\n",
|
||
" text-align: right;\n",
|
||
" }\n",
|
||
"</style>\n",
|
||
"<table border=\"1\" class=\"dataframe\">\n",
|
||
" <thead>\n",
|
||
" <tr style=\"text-align: right;\">\n",
|
||
" <th></th>\n",
|
||
" <th>symbol</th>\n",
|
||
" <th>name</th>\n",
|
||
" <th>market_cap</th>\n",
|
||
" <th>sector</th>\n",
|
||
" <th>industry</th>\n",
|
||
" <th>beta</th>\n",
|
||
" <th>price</th>\n",
|
||
" <th>last_annual_dividend</th>\n",
|
||
" <th>volume</th>\n",
|
||
" <th>exchange</th>\n",
|
||
" <th>exchange_name</th>\n",
|
||
" <th>country</th>\n",
|
||
" <th>is_etf</th>\n",
|
||
" <th>actively_trading</th>\n",
|
||
" <th>isFund</th>\n",
|
||
" </tr>\n",
|
||
" </thead>\n",
|
||
" <tbody>\n",
|
||
" <tr>\n",
|
||
" <th>0</th>\n",
|
||
" <td>HDFCBANK.BO</td>\n",
|
||
" <td>HDFC Bank Limited</td>\n",
|
||
" <td>10790199234483</td>\n",
|
||
" <td>Financial Services</td>\n",
|
||
" <td>Banks - Regional</td>\n",
|
||
" <td>0.79</td>\n",
|
||
" <td>1420.55</td>\n",
|
||
" <td>19.0</td>\n",
|
||
" <td>216503</td>\n",
|
||
" <td>BSE</td>\n",
|
||
" <td>Bombay Stock Exchange</td>\n",
|
||
" <td>IN</td>\n",
|
||
" <td>False</td>\n",
|
||
" <td>True</td>\n",
|
||
" <td>False</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>1</th>\n",
|
||
" <td>HDFCBANK.NS</td>\n",
|
||
" <td>HDFC Bank Limited</td>\n",
|
||
" <td>10704479740109</td>\n",
|
||
" <td>Financial Services</td>\n",
|
||
" <td>Banks—Regional</td>\n",
|
||
" <td>0.714285</td>\n",
|
||
" <td>1420.15</td>\n",
|
||
" <td>19.0</td>\n",
|
||
" <td>16040740</td>\n",
|
||
" <td>NSE</td>\n",
|
||
" <td>National Stock Exchange of India</td>\n",
|
||
" <td>IN</td>\n",
|
||
" <td>False</td>\n",
|
||
" <td>True</td>\n",
|
||
" <td>False</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>2</th>\n",
|
||
" <td>ICICIBANK.BO</td>\n",
|
||
" <td>ICICI Bank Limited</td>\n",
|
||
" <td>7441727264794</td>\n",
|
||
" <td>Financial Services</td>\n",
|
||
" <td>Banks—Regional</td>\n",
|
||
" <td>0.825</td>\n",
|
||
" <td>1060.35</td>\n",
|
||
" <td>8.0</td>\n",
|
||
" <td>178844</td>\n",
|
||
" <td>BSE</td>\n",
|
||
" <td>Bombay Stock Exchange</td>\n",
|
||
" <td>IN</td>\n",
|
||
" <td>False</td>\n",
|
||
" <td>True</td>\n",
|
||
" <td>False</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>3</th>\n",
|
||
" <td>ICICIBANK.NS</td>\n",
|
||
" <td>ICICI Bank Limited</td>\n",
|
||
" <td>7440674537779</td>\n",
|
||
" <td>Financial Services</td>\n",
|
||
" <td>Banks—Regional</td>\n",
|
||
" <td>0.825</td>\n",
|
||
" <td>1060.2</td>\n",
|
||
" <td>8.0</td>\n",
|
||
" <td>10580709</td>\n",
|
||
" <td>NSE</td>\n",
|
||
" <td>National Stock Exchange of India</td>\n",
|
||
" <td>IN</td>\n",
|
||
" <td>False</td>\n",
|
||
" <td>True</td>\n",
|
||
" <td>False</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>4</th>\n",
|
||
" <td>SBIN.NS</td>\n",
|
||
" <td>State Bank of India</td>\n",
|
||
" <td>6692118460570</td>\n",
|
||
" <td>Financial Services</td>\n",
|
||
" <td>Banks—Regional</td>\n",
|
||
" <td>0.781</td>\n",
|
||
" <td>749.85</td>\n",
|
||
" <td>11.3</td>\n",
|
||
" <td>13966117</td>\n",
|
||
" <td>NSE</td>\n",
|
||
" <td>National Stock Exchange of India</td>\n",
|
||
" <td>IN</td>\n",
|
||
" <td>False</td>\n",
|
||
" <td>True</td>\n",
|
||
" <td>False</td>\n",
|
||
" </tr>\n",
|
||
" </tbody>\n",
|
||
"</table>\n",
|
||
"</div>"
|
||
],
|
||
"text/plain": [
|
||
" symbol name market_cap sector \\\n",
|
||
"0 HDFCBANK.BO HDFC Bank Limited 10790199234483 Financial Services \n",
|
||
"1 HDFCBANK.NS HDFC Bank Limited 10704479740109 Financial Services \n",
|
||
"2 ICICIBANK.BO ICICI Bank Limited 7441727264794 Financial Services \n",
|
||
"3 ICICIBANK.NS ICICI Bank Limited 7440674537779 Financial Services \n",
|
||
"4 SBIN.NS State Bank of India 6692118460570 Financial Services \n",
|
||
"\n",
|
||
" industry beta price last_annual_dividend volume \\\n",
|
||
"0 Banks - Regional 0.79 1420.55 19.0 216503 \n",
|
||
"1 Banks—Regional 0.714285 1420.15 19.0 16040740 \n",
|
||
"2 Banks—Regional 0.825 1060.35 8.0 178844 \n",
|
||
"3 Banks—Regional 0.825 1060.2 8.0 10580709 \n",
|
||
"4 Banks—Regional 0.781 749.85 11.3 13966117 \n",
|
||
"\n",
|
||
" exchange exchange_name country is_etf \\\n",
|
||
"0 BSE Bombay Stock Exchange IN False \n",
|
||
"1 NSE National Stock Exchange of India IN False \n",
|
||
"2 BSE Bombay Stock Exchange IN False \n",
|
||
"3 NSE National Stock Exchange of India IN False \n",
|
||
"4 NSE National Stock Exchange of India IN False \n",
|
||
"\n",
|
||
" actively_trading isFund \n",
|
||
"0 True False \n",
|
||
"1 True False \n",
|
||
"2 True False \n",
|
||
"3 True False \n",
|
||
"4 True False "
|
||
]
|
||
},
|
||
"execution_count": 14,
|
||
"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": 15,
|
||
"metadata": {},
|
||
"outputs": [
|
||
{
|
||
"data": {
|
||
"text/plain": [
|
||
"344"
|
||
]
|
||
},
|
||
"metadata": {},
|
||
"output_type": "display_data"
|
||
},
|
||
{
|
||
"data": {
|
||
"text/html": [
|
||
"<div>\n",
|
||
"<style scoped>\n",
|
||
" .dataframe tbody tr th:only-of-type {\n",
|
||
" vertical-align: middle;\n",
|
||
" }\n",
|
||
"\n",
|
||
" .dataframe tbody tr th {\n",
|
||
" vertical-align: top;\n",
|
||
" }\n",
|
||
"\n",
|
||
" .dataframe thead th {\n",
|
||
" text-align: right;\n",
|
||
" }\n",
|
||
"</style>\n",
|
||
"<table border=\"1\" class=\"dataframe\">\n",
|
||
" <thead>\n",
|
||
" <tr style=\"text-align: right;\">\n",
|
||
" <th></th>\n",
|
||
" <th>symbol</th>\n",
|
||
" <th>name</th>\n",
|
||
" <th>market_cap</th>\n",
|
||
" <th>sector</th>\n",
|
||
" <th>industry</th>\n",
|
||
" <th>beta</th>\n",
|
||
" <th>price</th>\n",
|
||
" <th>last_annual_dividend</th>\n",
|
||
" <th>volume</th>\n",
|
||
" <th>exchange</th>\n",
|
||
" <th>exchange_name</th>\n",
|
||
" <th>country</th>\n",
|
||
" <th>is_etf</th>\n",
|
||
" <th>actively_trading</th>\n",
|
||
" <th>isFund</th>\n",
|
||
" </tr>\n",
|
||
" </thead>\n",
|
||
" <tbody>\n",
|
||
" <tr>\n",
|
||
" <th>0</th>\n",
|
||
" <td>PAGEIND.NS</td>\n",
|
||
" <td>Page Industries Limited</td>\n",
|
||
" <td>3.979243e+11</td>\n",
|
||
" <td>Consumer Cyclical</td>\n",
|
||
" <td>Apparel Manufacturing</td>\n",
|
||
" <td>0.517</td>\n",
|
||
" <td>35675.80</td>\n",
|
||
" <td>400.0</td>\n",
|
||
" <td>19671</td>\n",
|
||
" <td>NSE</td>\n",
|
||
" <td>National Stock Exchange of India</td>\n",
|
||
" <td>IN</td>\n",
|
||
" <td>False</td>\n",
|
||
" <td>True</td>\n",
|
||
" <td>False</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>1</th>\n",
|
||
" <td>PAGEIND.BO</td>\n",
|
||
" <td>Page Industries Limited</td>\n",
|
||
" <td>3.969506e+11</td>\n",
|
||
" <td>Consumer Cyclical</td>\n",
|
||
" <td>Apparel Manufacturing</td>\n",
|
||
" <td>0.517</td>\n",
|
||
" <td>35588.50</td>\n",
|
||
" <td>400.0</td>\n",
|
||
" <td>1161</td>\n",
|
||
" <td>BSE</td>\n",
|
||
" <td>Bombay Stock Exchange</td>\n",
|
||
" <td>IN</td>\n",
|
||
" <td>False</td>\n",
|
||
" <td>True</td>\n",
|
||
" <td>False</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>2</th>\n",
|
||
" <td>KPRMILL.NS</td>\n",
|
||
" <td>K.P.R. Mill Limited</td>\n",
|
||
" <td>2.616415e+11</td>\n",
|
||
" <td>Consumer Cyclical</td>\n",
|
||
" <td>Apparel Manufacturing</td>\n",
|
||
" <td>0.751</td>\n",
|
||
" <td>765.45</td>\n",
|
||
" <td>4.5</td>\n",
|
||
" <td>829576</td>\n",
|
||
" <td>NSE</td>\n",
|
||
" <td>National Stock Exchange of India</td>\n",
|
||
" <td>IN</td>\n",
|
||
" <td>False</td>\n",
|
||
" <td>True</td>\n",
|
||
" <td>False</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>3</th>\n",
|
||
" <td>KPRMILL.BO</td>\n",
|
||
" <td>K.P.R. Mill Limited</td>\n",
|
||
" <td>2.615561e+11</td>\n",
|
||
" <td>Consumer Cyclical</td>\n",
|
||
" <td>Textile Manufacturing</td>\n",
|
||
" <td>0.751</td>\n",
|
||
" <td>765.20</td>\n",
|
||
" <td>4.5</td>\n",
|
||
" <td>9053</td>\n",
|
||
" <td>BSE</td>\n",
|
||
" <td>Bombay Stock Exchange</td>\n",
|
||
" <td>IN</td>\n",
|
||
" <td>False</td>\n",
|
||
" <td>True</td>\n",
|
||
" <td>False</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>4</th>\n",
|
||
" <td>MANYAVAR.BO</td>\n",
|
||
" <td>Vedant Fashions Limited</td>\n",
|
||
" <td>2.406450e+11</td>\n",
|
||
" <td>Consumer Cyclical</td>\n",
|
||
" <td>Apparel Manufacturing</td>\n",
|
||
" <td>-0.348</td>\n",
|
||
" <td>990.90</td>\n",
|
||
" <td>9.0</td>\n",
|
||
" <td>4248</td>\n",
|
||
" <td>BSE</td>\n",
|
||
" <td>Bombay Stock Exchange</td>\n",
|
||
" <td>IN</td>\n",
|
||
" <td>False</td>\n",
|
||
" <td>True</td>\n",
|
||
" <td>False</td>\n",
|
||
" </tr>\n",
|
||
" </tbody>\n",
|
||
"</table>\n",
|
||
"</div>"
|
||
],
|
||
"text/plain": [
|
||
" symbol name market_cap sector \\\n",
|
||
"0 PAGEIND.NS Page Industries Limited 3.979243e+11 Consumer Cyclical \n",
|
||
"1 PAGEIND.BO Page Industries Limited 3.969506e+11 Consumer Cyclical \n",
|
||
"2 KPRMILL.NS K.P.R. Mill Limited 2.616415e+11 Consumer Cyclical \n",
|
||
"3 KPRMILL.BO K.P.R. Mill Limited 2.615561e+11 Consumer Cyclical \n",
|
||
"4 MANYAVAR.BO Vedant Fashions Limited 2.406450e+11 Consumer Cyclical \n",
|
||
"\n",
|
||
" industry beta price last_annual_dividend volume \\\n",
|
||
"0 Apparel Manufacturing 0.517 35675.80 400.0 19671 \n",
|
||
"1 Apparel Manufacturing 0.517 35588.50 400.0 1161 \n",
|
||
"2 Apparel Manufacturing 0.751 765.45 4.5 829576 \n",
|
||
"3 Textile Manufacturing 0.751 765.20 4.5 9053 \n",
|
||
"4 Apparel Manufacturing -0.348 990.90 9.0 4248 \n",
|
||
"\n",
|
||
" exchange exchange_name country is_etf \\\n",
|
||
"0 NSE National Stock Exchange of India IN False \n",
|
||
"1 BSE Bombay Stock Exchange IN False \n",
|
||
"2 NSE National Stock Exchange of India IN False \n",
|
||
"3 BSE Bombay Stock Exchange IN False \n",
|
||
"4 BSE Bombay Stock Exchange IN False \n",
|
||
"\n",
|
||
" actively_trading isFund \n",
|
||
"0 True False \n",
|
||
"1 True False \n",
|
||
"2 True False \n",
|
||
"3 True False \n",
|
||
"4 True False "
|
||
]
|
||
},
|
||
"execution_count": 15,
|
||
"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)"
|
||
]
|
||
},
|
||
{
|
||
"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": 16,
|
||
"metadata": {},
|
||
"outputs": [
|
||
{
|
||
"data": {
|
||
"text/plain": [
|
||
"4"
|
||
]
|
||
},
|
||
"metadata": {},
|
||
"output_type": "display_data"
|
||
},
|
||
{
|
||
"data": {
|
||
"text/html": [
|
||
"<div>\n",
|
||
"<style scoped>\n",
|
||
" .dataframe tbody tr th:only-of-type {\n",
|
||
" vertical-align: middle;\n",
|
||
" }\n",
|
||
"\n",
|
||
" .dataframe tbody tr th {\n",
|
||
" vertical-align: top;\n",
|
||
" }\n",
|
||
"\n",
|
||
" .dataframe thead th {\n",
|
||
" text-align: right;\n",
|
||
" }\n",
|
||
"</style>\n",
|
||
"<table border=\"1\" class=\"dataframe\">\n",
|
||
" <thead>\n",
|
||
" <tr style=\"text-align: right;\">\n",
|
||
" <th></th>\n",
|
||
" <th>symbol</th>\n",
|
||
" <th>name</th>\n",
|
||
" <th>market_cap</th>\n",
|
||
" <th>sector</th>\n",
|
||
" <th>industry</th>\n",
|
||
" <th>beta</th>\n",
|
||
" <th>price</th>\n",
|
||
" <th>volume</th>\n",
|
||
" <th>exchange</th>\n",
|
||
" <th>exchange_name</th>\n",
|
||
" <th>country</th>\n",
|
||
" <th>is_etf</th>\n",
|
||
" <th>actively_trading</th>\n",
|
||
" <th>isFund</th>\n",
|
||
" </tr>\n",
|
||
" </thead>\n",
|
||
" <tbody>\n",
|
||
" <tr>\n",
|
||
" <th>0</th>\n",
|
||
" <td>AMBO</td>\n",
|
||
" <td>Ambow Education Holding Ltd.</td>\n",
|
||
" <td>63818550</td>\n",
|
||
" <td>Consumer Defensive</td>\n",
|
||
" <td>Education & Training Services</td>\n",
|
||
" <td>0.559</td>\n",
|
||
" <td>2.2500</td>\n",
|
||
" <td>27302</td>\n",
|
||
" <td>AMEX</td>\n",
|
||
" <td>American Stock Exchange</td>\n",
|
||
" <td>CN</td>\n",
|
||
" <td>False</td>\n",
|
||
" <td>True</td>\n",
|
||
" <td>False</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>1</th>\n",
|
||
" <td>CPHI</td>\n",
|
||
" <td>China Pharma Holdings, Inc.</td>\n",
|
||
" <td>4107363</td>\n",
|
||
" <td>Healthcare</td>\n",
|
||
" <td>Drug Manufacturers—Specialty & Generic</td>\n",
|
||
" <td>0.970</td>\n",
|
||
" <td>0.0774</td>\n",
|
||
" <td>848792</td>\n",
|
||
" <td>AMEX</td>\n",
|
||
" <td>American Stock Exchange</td>\n",
|
||
" <td>CN</td>\n",
|
||
" <td>False</td>\n",
|
||
" <td>True</td>\n",
|
||
" <td>False</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>2</th>\n",
|
||
" <td>ITP</td>\n",
|
||
" <td>IT Tech Packaging, Inc.</td>\n",
|
||
" <td>3104324</td>\n",
|
||
" <td>Basic Materials</td>\n",
|
||
" <td>Paper & Paper Products</td>\n",
|
||
" <td>-0.224</td>\n",
|
||
" <td>0.3084</td>\n",
|
||
" <td>6467</td>\n",
|
||
" <td>AMEX</td>\n",
|
||
" <td>American Stock Exchange</td>\n",
|
||
" <td>CN</td>\n",
|
||
" <td>False</td>\n",
|
||
" <td>True</td>\n",
|
||
" <td>False</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>3</th>\n",
|
||
" <td>DXF</td>\n",
|
||
" <td>Dunxin Financial Holdings Limited</td>\n",
|
||
" <td>1375084</td>\n",
|
||
" <td>Financial Services</td>\n",
|
||
" <td>Credit Services</td>\n",
|
||
" <td>1.154</td>\n",
|
||
" <td>0.3460</td>\n",
|
||
" <td>39167</td>\n",
|
||
" <td>AMEX</td>\n",
|
||
" <td>American Stock Exchange</td>\n",
|
||
" <td>CN</td>\n",
|
||
" <td>False</td>\n",
|
||
" <td>True</td>\n",
|
||
" <td>False</td>\n",
|
||
" </tr>\n",
|
||
" </tbody>\n",
|
||
"</table>\n",
|
||
"</div>"
|
||
],
|
||
"text/plain": [
|
||
" symbol name market_cap sector \\\n",
|
||
"0 AMBO Ambow Education Holding Ltd. 63818550 Consumer Defensive \n",
|
||
"1 CPHI China Pharma Holdings, Inc. 4107363 Healthcare \n",
|
||
"2 ITP IT Tech Packaging, Inc. 3104324 Basic Materials \n",
|
||
"3 DXF Dunxin Financial Holdings Limited 1375084 Financial Services \n",
|
||
"\n",
|
||
" industry beta price volume exchange \\\n",
|
||
"0 Education & Training Services 0.559 2.2500 27302 AMEX \n",
|
||
"1 Drug Manufacturers—Specialty & Generic 0.970 0.0774 848792 AMEX \n",
|
||
"2 Paper & Paper Products -0.224 0.3084 6467 AMEX \n",
|
||
"3 Credit Services 1.154 0.3460 39167 AMEX \n",
|
||
"\n",
|
||
" exchange_name country is_etf actively_trading isFund \n",
|
||
"0 American Stock Exchange CN False True False \n",
|
||
"1 American Stock Exchange CN False True False \n",
|
||
"2 American Stock Exchange CN False True False \n",
|
||
"3 American Stock Exchange CN False True False "
|
||
]
|
||
},
|
||
"execution_count": 16,
|
||
"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\n"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "markdown",
|
||
"metadata": {},
|
||
"source": [
|
||
"### Filter by Metric\n",
|
||
"\n",
|
||
"Applying some filters refines and targets the search. The example below finds listing on the NYSE domiciled in the USA, with a market cap between $100-300 billion, and exhibiting a beta value of less than 0.5"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"execution_count": 17,
|
||
"metadata": {},
|
||
"outputs": [
|
||
{
|
||
"data": {
|
||
"text/html": [
|
||
"<div>\n",
|
||
"<style scoped>\n",
|
||
" .dataframe tbody tr th:only-of-type {\n",
|
||
" vertical-align: middle;\n",
|
||
" }\n",
|
||
"\n",
|
||
" .dataframe tbody tr th {\n",
|
||
" vertical-align: top;\n",
|
||
" }\n",
|
||
"\n",
|
||
" .dataframe thead th {\n",
|
||
" text-align: right;\n",
|
||
" }\n",
|
||
"</style>\n",
|
||
"<table border=\"1\" class=\"dataframe\">\n",
|
||
" <thead>\n",
|
||
" <tr style=\"text-align: right;\">\n",
|
||
" <th></th>\n",
|
||
" <th>symbol</th>\n",
|
||
" <th>name</th>\n",
|
||
" <th>market_cap</th>\n",
|
||
" <th>sector</th>\n",
|
||
" <th>industry</th>\n",
|
||
" <th>beta</th>\n",
|
||
" <th>price</th>\n",
|
||
" <th>last_annual_dividend</th>\n",
|
||
" <th>volume</th>\n",
|
||
" <th>exchange</th>\n",
|
||
" <th>exchange_name</th>\n",
|
||
" <th>country</th>\n",
|
||
" <th>is_etf</th>\n",
|
||
" <th>actively_trading</th>\n",
|
||
" <th>isFund</th>\n",
|
||
" </tr>\n",
|
||
" </thead>\n",
|
||
" <tbody>\n",
|
||
" <tr>\n",
|
||
" <th>0</th>\n",
|
||
" <td>VZ</td>\n",
|
||
" <td>Verizon Communications Inc.</td>\n",
|
||
" <td>166288131058</td>\n",
|
||
" <td>Communication Services</td>\n",
|
||
" <td>Telecom Services</td>\n",
|
||
" <td>0.403</td>\n",
|
||
" <td>39.5522</td>\n",
|
||
" <td>2.66</td>\n",
|
||
" <td>3715659</td>\n",
|
||
" <td>NYSE</td>\n",
|
||
" <td>New York Stock Exchange</td>\n",
|
||
" <td>US</td>\n",
|
||
" <td>False</td>\n",
|
||
" <td>True</td>\n",
|
||
" <td>False</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>1</th>\n",
|
||
" <td>PGR</td>\n",
|
||
" <td>The Progressive Corporation</td>\n",
|
||
" <td>111312278918</td>\n",
|
||
" <td>Financial Services</td>\n",
|
||
" <td>Insurance—Property & Casualty</td>\n",
|
||
" <td>0.345</td>\n",
|
||
" <td>190.0500</td>\n",
|
||
" <td>1.15</td>\n",
|
||
" <td>695689</td>\n",
|
||
" <td>NYSE</td>\n",
|
||
" <td>New York Stock Exchange</td>\n",
|
||
" <td>US</td>\n",
|
||
" <td>False</td>\n",
|
||
" <td>True</td>\n",
|
||
" <td>False</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>2</th>\n",
|
||
" <td>LMT</td>\n",
|
||
" <td>Lockheed Martin Corporation</td>\n",
|
||
" <td>103775136301</td>\n",
|
||
" <td>Industrials</td>\n",
|
||
" <td>Aerospace & Defense</td>\n",
|
||
" <td>0.488</td>\n",
|
||
" <td>429.4564</td>\n",
|
||
" <td>12.60</td>\n",
|
||
" <td>204961</td>\n",
|
||
" <td>NYSE</td>\n",
|
||
" <td>New York Stock Exchange</td>\n",
|
||
" <td>US</td>\n",
|
||
" <td>False</td>\n",
|
||
" <td>True</td>\n",
|
||
" <td>False</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>3</th>\n",
|
||
" <td>BMY</td>\n",
|
||
" <td>Bristol-Myers Squibb Company</td>\n",
|
||
" <td>101615045088</td>\n",
|
||
" <td>Healthcare</td>\n",
|
||
" <td>Drug Manufacturers—General</td>\n",
|
||
" <td>0.371</td>\n",
|
||
" <td>50.2500</td>\n",
|
||
" <td>2.40</td>\n",
|
||
" <td>2113879</td>\n",
|
||
" <td>NYSE</td>\n",
|
||
" <td>New York Stock Exchange</td>\n",
|
||
" <td>US</td>\n",
|
||
" <td>False</td>\n",
|
||
" <td>True</td>\n",
|
||
" <td>False</td>\n",
|
||
" </tr>\n",
|
||
" </tbody>\n",
|
||
"</table>\n",
|
||
"</div>"
|
||
],
|
||
"text/plain": [
|
||
" symbol name market_cap sector \\\n",
|
||
"0 VZ Verizon Communications Inc. 166288131058 Communication Services \n",
|
||
"1 PGR The Progressive Corporation 111312278918 Financial Services \n",
|
||
"2 LMT Lockheed Martin Corporation 103775136301 Industrials \n",
|
||
"3 BMY Bristol-Myers Squibb Company 101615045088 Healthcare \n",
|
||
"\n",
|
||
" industry beta price last_annual_dividend \\\n",
|
||
"0 Telecom Services 0.403 39.5522 2.66 \n",
|
||
"1 Insurance—Property & Casualty 0.345 190.0500 1.15 \n",
|
||
"2 Aerospace & Defense 0.488 429.4564 12.60 \n",
|
||
"3 Drug Manufacturers—General 0.371 50.2500 2.40 \n",
|
||
"\n",
|
||
" volume exchange exchange_name country is_etf \\\n",
|
||
"0 3715659 NYSE New York Stock Exchange US False \n",
|
||
"1 695689 NYSE New York Stock Exchange US False \n",
|
||
"2 204961 NYSE New York Stock Exchange US False \n",
|
||
"3 2113879 NYSE New York Stock Exchange US False \n",
|
||
"\n",
|
||
" actively_trading isFund \n",
|
||
"0 True False \n",
|
||
"1 True False \n",
|
||
"2 True False \n",
|
||
"3 True False "
|
||
]
|
||
},
|
||
"execution_count": 17,
|
||
"metadata": {},
|
||
"output_type": "execute_result"
|
||
}
|
||
],
|
||
"source": [
|
||
"obb.equity.screener(\n",
|
||
" exchange=\"nyse\",\n",
|
||
" mktcap_min=100000000000,\n",
|
||
" mktcap_max=300000000000,\n",
|
||
" country=\"us\",\n",
|
||
" beta_max=0.5,\n",
|
||
" provider=\"fmp\",\n",
|
||
").to_df()"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "markdown",
|
||
"metadata": {},
|
||
"source": [
|
||
"## Get Available Indices\n",
|
||
"\n",
|
||
"List all indices from a source with:"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "code",
|
||
"execution_count": 18,
|
||
"metadata": {},
|
||
"outputs": [
|
||
{
|
||
"name": "stdout",
|
||
"output_type": "stream",
|
||
"text": [
|
||
"274\n"
|
||
]
|
||
},
|
||
{
|
||
"data": {
|
||
"text/html": [
|
||
"<div>\n",
|
||
"<style scoped>\n",
|
||
" .dataframe tbody tr th:only-of-type {\n",
|
||
" vertical-align: middle;\n",
|
||
" }\n",
|
||
"\n",
|
||
" .dataframe tbody tr th {\n",
|
||
" vertical-align: top;\n",
|
||
" }\n",
|
||
"\n",
|
||
" .dataframe thead th {\n",
|
||
" text-align: right;\n",
|
||
" }\n",
|
||
"</style>\n",
|
||
"<table border=\"1\" class=\"dataframe\">\n",
|
||
" <thead>\n",
|
||
" <tr style=\"text-align: right;\">\n",
|
||
" <th></th>\n",
|
||
" <th>name</th>\n",
|
||
" <th>code</th>\n",
|
||
" <th>symbol</th>\n",
|
||
" </tr>\n",
|
||
" </thead>\n",
|
||
" <tbody>\n",
|
||
" <tr>\n",
|
||
" <th>88</th>\n",
|
||
" <td>S&P/ASX 200 Index (AUD)</td>\n",
|
||
" <td>au_asx200</td>\n",
|
||
" <td>^AXJO</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>90</th>\n",
|
||
" <td>S&P/ASX 200 Energy Sector Index (AUD)</td>\n",
|
||
" <td>au_energy</td>\n",
|
||
" <td>^AXEJ</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>91</th>\n",
|
||
" <td>S&P/ASX 200 Resources Sector Index (AUD)</td>\n",
|
||
" <td>au_resources</td>\n",
|
||
" <td>^AXJR</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>92</th>\n",
|
||
" <td>S&P/ASX 200 Materials Sector Index (AUD)</td>\n",
|
||
" <td>au_materials</td>\n",
|
||
" <td>^AXMJ</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>94</th>\n",
|
||
" <td>S&P/ASX 200 Industrials Sector Index (AUD)</td>\n",
|
||
" <td>au_industrials</td>\n",
|
||
" <td>^AXNJ</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>95</th>\n",
|
||
" <td>S&P/ASX 200 Consumer Discretionary Sector Inde...</td>\n",
|
||
" <td>au_discretionary</td>\n",
|
||
" <td>^AXDJ</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>96</th>\n",
|
||
" <td>S&P/ASX 200 Consumer Staples Sector Index (AUD)</td>\n",
|
||
" <td>au_staples</td>\n",
|
||
" <td>^AXSJ</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>97</th>\n",
|
||
" <td>S&P/ASX 200 Health Care Sector Index (AUD)</td>\n",
|
||
" <td>au_health</td>\n",
|
||
" <td>^AXHJ</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>98</th>\n",
|
||
" <td>S&P/ASX 200 Financials Sector Index (AUD)</td>\n",
|
||
" <td>au_financials</td>\n",
|
||
" <td>^AXFJ</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>99</th>\n",
|
||
" <td>S&P/ASX 200 A-REIT Industry Index (AUD)</td>\n",
|
||
" <td>au_reit</td>\n",
|
||
" <td>^AXPJ</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>100</th>\n",
|
||
" <td>S&P/ASX 200 Info Tech Sector Index (AUD)</td>\n",
|
||
" <td>au_tech</td>\n",
|
||
" <td>^AXIJ</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>101</th>\n",
|
||
" <td>S&P/ASX 200 Communications Sector Index (AUD)</td>\n",
|
||
" <td>au_communications</td>\n",
|
||
" <td>^AXTJ</td>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>102</th>\n",
|
||
" <td>S&P/ASX 200 Utilities Sector Index (AUD)</td>\n",
|
||
" <td>au_utilities</td>\n",
|
||
" <td>^AXUJ</td>\n",
|
||
" </tr>\n",
|
||
" </tbody>\n",
|
||
"</table>\n",
|
||
"</div>"
|
||
],
|
||
"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": 18,
|
||
"metadata": {},
|
||
"output_type": "execute_result"
|
||
}
|
||
],
|
||
"source": [
|
||
"indices = obb.index.available(provider=\"yfinance\").to_df()\n",
|
||
"print(len(indices))\n",
|
||
"\n",
|
||
"indices[indices[\"name\"].str.contains(\"ASX 200\")]"
|
||
]
|
||
},
|
||
{
|
||
"cell_type": "markdown",
|
||
"metadata": {},
|
||
"source": [
|
||
"Filter the list down by querying the DataFrame."
|
||
]
|
||
},
|
||
{
|
||
"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": 21,
|
||
"metadata": {},
|
||
"outputs": [
|
||
{
|
||
"data": {
|
||
"text/html": [
|
||
"<div>\n",
|
||
"<style scoped>\n",
|
||
" .dataframe tbody tr th:only-of-type {\n",
|
||
" vertical-align: middle;\n",
|
||
" }\n",
|
||
"\n",
|
||
" .dataframe tbody tr th {\n",
|
||
" vertical-align: top;\n",
|
||
" }\n",
|
||
"\n",
|
||
" .dataframe thead th {\n",
|
||
" text-align: right;\n",
|
||
" }\n",
|
||
"</style>\n",
|
||
"<table border=\"1\" class=\"dataframe\">\n",
|
||
" <thead>\n",
|
||
" <tr style=\"text-align: right;\">\n",
|
||
" <th></th>\n",
|
||
" <th>open</th>\n",
|
||
" <th>high</th>\n",
|
||
" <th>low</th>\n",
|
||
" <th>close</th>\n",
|
||
" <th>volume</th>\n",
|
||
" </tr>\n",
|
||
" <tr>\n",
|
||
" <th>date</th>\n",
|
||
" <th></th>\n",
|
||
" <th></th>\n",
|
||
" <th></th>\n",
|
||
" <th></th>\n",
|
||
" <th></th>\n",
|
||
" </tr>\n",
|
||
" </thead>\n",
|
||
" <tbody>\n",
|
||
" <tr>\n",
|
||
" <th>2024-02-27</th>\n",
|
||
" <td>True</td>\n",
|
||
" <td>True</td>\n",
|
||
" <td>True</td>\n",
|
||
" <td>True</td>\n",
|
||
" <td>True</td>\n",
|
||
" </tr>\n",
|
||
" </tbody>\n",
|
||
"</table>\n",
|
||
"</div>"
|
||
],
|
||
"text/plain": [
|
||
" open high low close volume\n",
|
||
"date \n",
|
||
"2024-02-27 True True True True True"
|
||
]
|
||
},
|
||
"execution_count": 21,
|
||
"metadata": {},
|
||
"output_type": "execute_result"
|
||
}
|
||
],
|
||
"source": [
|
||
"(\n",
|
||
" obb.index.price.historical(\"au_utilities\", provider=\"yfinance\").to_df().tail(1)\n",
|
||
" == obb.index.price.historical(\"^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.7"
|
||
}
|
||
},
|
||
"nbformat": 4,
|
||
"nbformat_minor": 2
|
||
}
|