{"id":16281194,"url":"https://github.com/ismet55555/interactive_broker_playground","last_synced_at":"2025-04-08T17:44:18.033Z","repository":{"id":105025407,"uuid":"407969391","full_name":"ismet55555/interactive_broker_playground","owner":"ismet55555","description":"Just testing things out with interactive broker API","archived":false,"fork":false,"pushed_at":"2023-01-23T21:46:41.000Z","size":97,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-02-14T14:17:15.812Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ismet55555.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-09-18T21:16:42.000Z","updated_at":"2023-03-05T19:17:39.000Z","dependencies_parsed_at":null,"dependency_job_id":"1d642b27-acc1-4e1a-960d-4009101f4e50","html_url":"https://github.com/ismet55555/interactive_broker_playground","commit_stats":{"total_commits":9,"total_committers":2,"mean_commits":4.5,"dds":"0.11111111111111116","last_synced_commit":"f8888224d1f1500f10832fafcb78bb70db826e31"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ismet55555%2Finteractive_broker_playground","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ismet55555%2Finteractive_broker_playground/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ismet55555%2Finteractive_broker_playground/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ismet55555%2Finteractive_broker_playground/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ismet55555","download_url":"https://codeload.github.com/ismet55555/interactive_broker_playground/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247895757,"owners_count":21014379,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-10T19:05:36.005Z","updated_at":"2025-04-08T17:44:18.012Z","avatar_url":"https://github.com/ismet55555.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# interactive_broker_playground\n\nIn this repository we are simply playing around with the Interactive Brokers API\n\n# Repo Setup\n\nThis repository is divided into two sections.\n\n1. Native API Scripts (`native_api`)\n\n   - This library is developed and maintained by Interactive Brokers\n   - It is downloaded via the Interactive Brokers website and installed manually\n   - Documentation: https://interactivebrokers.github.io/tws-api/index.html\n\n2. `ib_insync`\n   - This library is a wrapper on the native interactive broker API\n   - It makes working with the native library easier and asynchronous\n   - GitHub Repo: https://github.com/erdewit/ib_insync\n\n# Installation and Setup\n\n### Interactive Broker Trader Workstation (TWS)\n\nIn order to use any code that interacts with the interactive broker servers, a local client has to be installed.\nThis local client can either be the TWS or the Interactive Broker Gateway.\n\n- TWS: Download, install, run, and log-in\n\n  - https://www.interactivebrokers.com/en/index.php?f=16042\n\n- TWS: Change Settings\n  - File \u003e Global Configuration \u003e API \u003e Settings\n  - Check: `Enable ActiveX and Socket Clients`\n  - Uncheck: `Read-Only API`\n  - Ensure: `Socket port: 7497`\n  - Check: `Allow connections form localhost only` _(Uncheck if connecting from remote computer)_\n\n# Market/Data Analysis Tools\n\nInteractive brokers API is great for getting data and managing orders, however for any data or market analysis another tools needed. The following tools enable any technical analysis.\n\n### Stockstats\n\nA open-source technical analysis tool for python.\n\n- GitHub Repo: https://github.com/jealous/stockstats\n- `pip install stockstats`\n\n### TA-Lib Market Analysis Tool\n\nTA-Lib is an open-source technical analysis toolkit. See [home page](https://ta-lib.org/).\nWhile the original library is not available in Python, a wrapper is available to allow Python users access.\n\n- GitHub Repo: https://github.com/mrjbq7/ta-lib\n- Follow instructions how to download compressed file and build from source\n- `pip install ta-lib`\n\n### Bta-Lib Market Analysis Tool\n\n- GitHub Repo: https://github.com/mementum/bta-lib\n- Website: https://btalib.backtrader.com/\n- `pip install bta-lib`\n\n# NOTES\n\n- Connection\n\n  - `Python API \u003c-\u003e TWS/Gateway Client \u003c-\u003e Interactive Broker Servers`\n\n- Python Script Communication\n\n  - Outgoing: `Python Script -\u003e EClient -\u003e TWS/Gateway Client`\n  - Incoming: `Python Script \u003c- EWrapper \u003c- TWS/Gateway Client`\n\n- Sector Types\n  - 'STK' = Stock (or ETF)\n  - 'OPT' = Option\n  - 'FUT' = Future\n  - 'IND' = Index\n  - 'FOP' = Futures option\n  - 'CASH' = Forex pair\n  - 'CFD' = CFD\n  - 'BAG' = Combo\n  - 'WAR' = Warrant\n  - 'BOND'= Bond\n  - 'CMDTY'= Commodity\n  - 'NEWS' = News\n  - 'FUND'= Mutual fund\n\n- P1L0veTorontoUrenan823\n\n# Links\n\n- Native Python API\n\n  - [Tutorial](https://algotrading101.com/learn/interactive-brokers-python-api-native-guide/)\n  - [Available Tick Types](https://interactivebrokers.github.io/tws-api/tick_types.html)\n  - [Market Data Types](https://interactivebrokers.github.io/tws-api/market_data_type.html)\n\n  - Historical Data\n\n    - [Requesting Historical Bar Data](https://interactivebrokers.github.io/tws-api/historical_bars.html)\n    - [Historical Data Limitations](https://interactivebrokers.github.io/tws-api/historical_limitations.html)\n    - Examples:\n      - [Get Historical Data - Github Gist](https://gist.github.com/robcarver17/f50aeebc2ecd084f818706d9f05c1eb4#file-temp-py)\n      - [CLI to Download Historical Data - GitHub Gist](https://gist.github.com/wrighter/dd201adb09518b3c1d862255238d2534)\n      - [Receiving Market Data and Historical Candlesticks](https://tradersacademy.online/trading-topics/trader-workstation-tws/receiving-market-data-and-historical-candlesticks)\n\n  - Orders\n\n    - [Available Orders](https://interactivebrokers.github.io/tws-api/available_orders.html)\n    - [Order Managment](https://interactivebrokers.github.io/tws-api/order_management.html)\n\n  - Message Codes\n    - [Message Codes](https://interactivebrokers.github.io/tws-api/message_codes.html)\n\n- `ib_insync` Python Library\n\n  - Details:\n    - Utilizes asynchronous methods to communicate with the native API to increase efficiency.\n    - Utilizes the asyncio library to provide an asynchronous single thread to interact with the API\n    - Simplifies the process of receiving data from the API.\n  - [Tutorial](https://algotrading101.com/learn/ib_insync-interactive-brokers-api-guide/)\n  - [Code Recipes](https://github.com/erdewit/ib_insync/blob/master/docs/recipes.rst)\n  - [Tkinter UI Example](https://github.com/erdewit/ib_insync/blob/master/examples/tk.py)\n  - [Market Scanner Examples](https://groups.io/g/insync/topic/market_data_scanners/22402297?p=,,,20,0,0,0::recentpostdate/sticky,,,20,2,0,22402297,previd=9223372036854775807,nextid=1630545430030066183\u0026previd=9223372036854775807\u0026nextid=1630545430030066183)\n  - [Examples](https://market-and-us.com/blog/how-to-code-all-about-orders-with-interactive-brokers-475/)\n  - [Presentation for Jupyter Notebook](https://www.palmislandtraders.com/econ136/ib_api.pdf)\n\n- `IbPy` Python Library\n  - Another library and a wrapper of the Interactive Broker API\n  - [GitHub Repo](https://github.com/blampe/IbPy)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fismet55555%2Finteractive_broker_playground","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fismet55555%2Finteractive_broker_playground","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fismet55555%2Finteractive_broker_playground/lists"}