Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Interactive Brokers listings #30

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions DISCLAIMER.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
## Disclaimer

We are doing our best to prepare the content of this site. However, the contributors of `degiro-wrapper` cannot warranty the expressions and suggestions of the contents, as well as its accuracy. In addition, to the extent permitted by the law, the contributors of `degiro-wrapper` shall not be responsible for any losses and/or damages due to the usage of the information on our website.

By using our website, you hereby consent to our disclaimer and agree to its terms.

The links contained on our website may lead to external sites, which are provided for convenience only. Any information or statements that appeared in these sites are not sponsored, endorsed, or otherwise approved by the contributors of `degiro-wrapper`. For these external sites, the contributors of `degiro-wrapper` cannot be held liable for the availability of, or the content located on or through it. Plus, any losses or damages occurred from using these contents or the internet generally.
8,033 changes: 8,033 additions & 0 deletions data/interactive_brokers/etfs.csv

Large diffs are not rendered by default.

118 changes: 118 additions & 0 deletions data/interactive_brokers/listings.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
Country/Region;Products;Hours
Vienna Stock Exchange (VSE);"Indices
Stocks";Monday - Friday: 9:00-17:40
Bats Europe (BATEEN);Stocks;Monday - Friday: 800 - 1630
CHI-X Europe Ltd Clearnet (CHIXEN);Stocks;Monday - Friday: 800 - 1630
ENEXT.BE;Stocks;Monday - Friday: 9:00-17:40
Euronext Brussels (BELFOX);"Futures (Equity Index)
Indices
Options (Equity Index)";Monday - Friday: 9:00-17:35
Turquoise (TRQXEN);Stocks;Monday - Friday: 800 - 1630
Nasdaq Baltic (N.TALLINN);Stocks;Mon-Fri 10:00-16:00 (EET)
Euronext Bonds;Fixed Income (Corporate and Non-US Sovereign);Monday - Friday: 14:59-23:59
Bats Europe (BATEEN);Stocks;Monday - Friday: 800 - 1630
CHI-X Europe Ltd Clearnet (CHIXEN);Stocks;Monday - Friday: 800 - 1630
Euronext France (MATIF);"Futures (Agriculture)
Indices";Monday - Friday: 10:45-18:30
Euronext France (MONEP);"Futures (Equity Index)
Indices
Options (Equity, Equity Index)";"Options: 9:00 - 17:30 CET
Futures: 8:00 - 22:00 CET"
Euronext France (SBF);"ETFs
Stocks
Structured Products (Turbos and Certificates)
Warrants (Index, Stock)";Monday - Friday: 9:00-17:40
Turquoise (TRQXEN);Stocks;Monday - Friday: 800 - 1630
Bats Europe (BATEDE);Stocks;Monday - Friday: 8:00 - 16:30
CBOE EU;Stocks;Monday - Friday: 800 - 1630
CHI-X Europe Ltd Clearstream (CHIXDE);"ETFs
Stocks";Monday - Friday: 9:00-17:30
EUREX (DTB);"Futures (Equity Index, Fixed Income, Single Stock)
Futures Options (Fixed Income)
Indices
Options (Equity, Equity Index)";Monday - Friday: 9:00-22:05
Frankfurt Stock Exchange (FWB);"ETFs
Stocks
Structured Products (Turbos and Certificates)
Warrants (Index, Stock)";Monday - Friday: 8:00-20:00
Stuttgart Stock Exchange (SWB);"ETFs
Stocks
Structured Products (Turbos and Certificates)
Warrants (Index, Stock)";Monday - Friday: 8:00-22:00
Tradegate Exchange (TRADEGATE);Stocks;Monday - Friday: 9:00-20:00
Turquoise DE (TRQXDE);Stocks;Monday - Friday: 9:00-17:30
XETRA (IBIS);"ETFs
Indices
Stocks";Monday - Friday: 9:00-17:40
Budapest Stock Exchange;Stocks;Monday - Friday: 9:00-17:20
Tel Aviv Stock Exchange;"ETFs
Stocks";"Sun 9:30 - 16:251
Mon-Thurs 9:30-17:151
1See Exchange site for details
Israel Standard Time"
Borsa Italiana;ETFs;Monday - Friday: 9:00-17:42
Borsa Italiana (BVME);"Indices
Stocks
Structured Products
Warrants (Index, Stock)";Monday - Friday: 9:00-17:42
Borsa Italiana (IDEM);"Futures (Equity Index, Single Stock)
Options (Equity, Equity Index)
Single Stock Futures";Monday - Friday: 9:00-17:50
Nasdaq Baltic (N.RIGA);Stocks;Mon-Fri 10:00-16:00 (EET)
Nasdaq Baltic (N.VILNIUS);Stocks;Mon-Fri 10:00-16:00 (EET)
Bats Europe (BATEEN);Stocks;Monday - Friday: 8:00-16:30
CHI-X Europe Ltd Clearnet (CHIXEN);"ETFs
Stocks";Monday - Friday: 9:00-17:30
Euronext NL Derivatives (FTA);"Futures (Currency, Equity Index)
Indices
Options (Currency, Equity, Equity Index)";Monday - Friday: 9:00-22:00
Euronext NL Stocks (AEB);"ETFs
Stocks
Structured Products (Turbos and Certificates)";Monday - Friday: 9:00-17:40
Turquoise (TRQXEN);Stocks;Monday - Friday: 9:00-17:30
OMXNO;Stocks;Monday - Friday: 9:00-16:20
Warsaw Stock Exchange;Stocks;Monday - Friday: 11:00-17:05
BVL;Stocks;Monday - Friday: 8:00-18:05
Moscow Exchange;Stocks;9:30-19:00 MSK
Bats Europe (BATEES);Stocks;Monday - Friday: 8:00-16:30
Bolsa de Madrid (BM);"ETFs
Indices
Stocks";Monday - Friday: 9:00-17:35
CHI-X Europe Ltd Clearnet (CHIXES);Stocks;Monday - Friday: 9:00-17:30
Spanish Futures & Options Exchange (MEFF);"Futures (Equity Index, Single Stock)
Indices
Options (Equity, Equity Index)";Monday - Friday: 9:00-17:35
Nasdaq OMX - Stockholm (OMS);"Futures (Equity Index)
Indices
Options (Equity)";Monday - Friday: 9:00-17:25
Swedish Stock Exchange (SFB);"ETFs
Indices
Stocks";Monday - Friday: 9:00-17:30
BATS Europe (BATECH);Stocks;Monday - Friday: 8:00-16:30
CHI-X Europe Ltd Swiss (CHIXCH);Stocks;Monday - Friday: 9:00-17:30
EUREX (SOFFEX);"Futures (Equity Index, Single Stock)
Indices
Options (Equity, Equity Index)";Monday - Friday: 8:00-22:00
SIX Swiss Exchange (EBS);"ETFs
Indices
Stocks
Warrants (Index, Stock)";Monday - Friday: 9:00-17:32
Turquoise CH (TRQXCH);Stocks;Monday - Friday: 9:00-17:30
VIRT-X (VIRTX);"Indices
Stocks";Monday - Friday: 9:00-17:32
Bats Europe (BATEUK);Stocks;Monday - Friday: 8:00-16:30
CHI-X Europe Ltd Crest (CHIXUK);"ETFs
Stocks";Monday - Friday: 8:00-16:30
Intercontinental Exchange (ICE/IPE);Futures (Energy);Monday - Sunday: 1:00-23:00
Intercontinental Exchange (ICEEU);"Futures (Equity Index, Fixed Income, Single Stock)
Futures Options (Fixed Income)
Indices
Options (Equity, Equity Index)";Monday - Friday: 8:00-18:00
Intercontinental Exchange (ICEEUSOFT);"Futures (Commodities)
Indices";Monday - Friday: 8:45-18:00
LME OTC Lookalike Platform;Futures;Mon-Fri 0100-1900 WET
London Stock Exchange (LSE);"ETFs
Indices
Stocks";Monday - Friday: 8:00-16:50
LSE ETF Exchange;ETFs;8:00-16:30 GMT
LSE International Order Book (LSEIOB1);Stocks;Monday - Friday: 9:00-17:00
222 changes: 222 additions & 0 deletions notebooks/Parse-IB-exchange-products.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,222 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"%load_ext autoreload\n",
"%autoreload 2"
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"import pandas as pd\n",
"from tqdm import tqdm as tqdm\n",
"from IPython.display import clear_output\n",
"\n",
"from model import parse_table, url_to_tree"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
"exchanges = [('sbf', 'Euronext France'), \n",
" ('chixde', 'CHI-X Europe Ltd Clearstream'),\n",
" ('fwb', 'Frankfurt Stock Exchange'),\n",
" ('swb', 'Stuttgart Stock Exchange'), \n",
" ('ibis', 'XETRA'), \n",
" ('chixen', 'CHI-X Europe Lts Clearnet'), \n",
" ('aeb', 'Euronext NL Stocks'), \n",
" ('bm', 'Bolsa de Madrid'), \n",
" ('sfb', 'Swedish Stock Exchange'), \n",
" ('ebs', 'SIX Swiss Exchange'),\n",
" ('chixuk', 'CHI-X Europe Ltd Crest'),\n",
" ('lse', 'London Stock Exchange'), \n",
" ('lseetf', 'London Stock ETF Exchange')]"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [],
"source": [
"xpaths = dict()\n",
"\n",
"xpaths[\"symbolIB\"] = '//*[@id=\"exchange-products\"]/div/div/div[3]/div/div/div/table/tbody/tr[{row}]/td[1]'\n",
"xpaths[\"name\"] = '//*[@id=\"exchange-products\"]/div/div/div[3]/div/div/div/table/tbody/tr[{row}]/td[2]/a'\n",
"xpaths[\"symbolTrading\"] = '//*[@id=\"exchange-products\"]/div/div/div[3]/div/div/div/table/tbody/tr[{row}]/td[3]'\n",
"xpaths[\"currency\"] = '//*[@id=\"exchange-products\"]/div/div/div[3]/div/div/div/table/tbody/tr[{row}]/td[4]'"
]
},
{
"cell_type": "code",
"execution_count": 11,
"metadata": {},
"outputs": [],
"source": [
"url = \"https://www.interactivebrokers.com/en/index.php?\"\n",
"url += \"f=2222&exch={exchange}&showcategories=ETF&p=&cc=&limit=100&page={page}\""
]
},
{
"cell_type": "code",
"execution_count": 13,
"metadata": {},
"outputs": [
{
"name": "stderr",
"output_type": "stream",
"text": [
"100%|██████████| 13/13 [04:20<00:00, 20.06s/it]\n"
]
}
],
"source": [
"# Add exchange\n",
"products = []\n",
"\n",
"# Collect exchange products\n",
"for exchange, _ in tqdm(exchanges):\n",
" \n",
" products_exchange = []\n",
" \n",
" # Collect page products\n",
" for page in tqdm(range(1, 100), leave = False):\n",
"\n",
" # Add page tag\n",
" _url_page = url.format(exchange=exchange, page = page)\n",
"\n",
" # Get tree\n",
" tree = url_to_tree(_url_page)\n",
"\n",
" # Parse table\n",
" products_page = parse_table(tree, xpaths)\n",
"\n",
" # If no products, this was the last page\n",
" if len(products_page) == 0:\n",
" break\n",
"\n",
" # Add page products to exchange products\n",
" products_exchange.extend(products_page)\n",
"\n",
" # Add products with their exchange referenced\n",
" for row in products_exchange:\n",
"\n",
" products.append(row + (exchange,))\n",
" \n",
" clear_output()"
]
},
{
"cell_type": "code",
"execution_count": 17,
"metadata": {},
"outputs": [],
"source": [
"products_df = pd.DataFrame(data = products, \n",
" columns = ['name', 'currency', 'symbolIB', 'symbolTrading', 'exchange'])"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"jupytext": {
"formats": "ipynb,py:percent"
},
"kernelspec": {
"display_name": "Python 3",
"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.6.10"
},
"latex_envs": {
"LaTeX_envs_menu_present": true,
"autoclose": false,
"autocomplete": true,
"bibliofile": "biblio.bib",
"cite_by": "apalike",
"current_citInitial": 1,
"eqLabelWithNumbers": true,
"eqNumInitial": 1,
"hotkeys": {
"equation": "Ctrl-E",
"itemize": "Ctrl-I"
},
"labels_anchors": false,
"latex_user_defs": false,
"report_style_numbering": false,
"user_envs_cfg": false
},
"toc": {
"base_numbering": 1,
"nav_menu": {},
"number_sections": true,
"sideBar": true,
"skip_h1_title": false,
"title_cell": "Table of Contents",
"title_sidebar": "Contents",
"toc_cell": false,
"toc_position": {},
"toc_section_display": true,
"toc_window_display": false
},
"varInspector": {
"cols": {
"lenName": 16,
"lenType": 16,
"lenVar": 40
},
"kernels_config": {
"python": {
"delete_cmd_postfix": "",
"delete_cmd_prefix": "del ",
"library": "var_list.py",
"varRefreshCmd": "print(var_dic_list())"
},
"r": {
"delete_cmd_postfix": ") ",
"delete_cmd_prefix": "rm(",
"library": "var_list.r",
"varRefreshCmd": "cat(var_dic_list()) "
}
},
"types_to_exclude": [
"module",
"function",
"builtin_function_or_method",
"instance",
"_Feature"
],
"window_display": false
}
},
"nbformat": 4,
"nbformat_minor": 4
}
Loading