# kgiapp
![PyPI](https://img.shields.io/pypi/v/kgiapp)
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/kgiapp)
![PyPI - Format](https://img.shields.io/pypi/format/kgiapp)
![PyPI - License](https://img.shields.io/pypi/l/kgiapp)
![PyPI - Downloads](https://img.shields.io/pypi/dm/kgiapp)
![contact](https://img.shields.io/badge/凱基證券)
凱基證券程式下單API整合了.net framework 4.5架構下的交易介面,讓使用者可以輕鬆的運用python執行快速下單。
>kgiapp is a securities, futures, option API, which send orders to Concord Securities Group.
This package integrated with .net framework 4.5, and is compatible with Python 3.5+.
It is distributed under the MIT license.
- [Installation](#installation)
- [Preinstall](#preinstall)
- [Binaries](#binaries)
- [Quick Starts](#quick-starts)
- [Login](#login)
- [Place Order](#place-order)
- [Stock](#stock)
- [Futures](#futures)
- [Foreign Futures](#foreign-futures)
- [Register Event](#register-event)
- [Quote](#quote)
- [Reference](#reference)
## Installation
### Preinstall
>API usage needs application in advance. In order to use this package, please contact us.
### Binaries
simply use pip to install
```
pip install kgiapp
```
## Quick Starts
### Login
```python
from kgiapp import TradeAPI
agent = TradeAPI(debug=False)
agent.login("YOUR_PERSON_ID", "YOUR_PASSWORD")
```
## Place Order
### Stock
```python
from kgiapp.Trade import constant
agent.stock_order(action=SecurityAction.NEW_ORDER, broker_no='YOUR_BROKER_NO', account_no='YOUR_ACCOUNT', lot_type=LotType.ROUND_LOT, order_type=OrderType.ORDINARY,
side=Side.BUY, symbol='2330', quantity=1, price=570, price_flag=SecurityPriceFlag.FIX, time_in_force=TimeInForce.ROD, sub_account_no='', agent_id='', order_id='')
```
### Futures
```python
agent.futures_order(action=Action.NEW_ORDER, branch_no='YOUR_BROKER_NO', account_no='YOUR_ACCOUNT', sub_account_no='', market_type=Market.FUTURES, tb_20_code='MXFB1',
time_in_force=TimeInForce.ROD, writeoff=WriteOff.OPEN, order_type=PriceFlag.LIMIT, side=Side.BUY, quantity=1, price=15100, web_id='', orig_net_no='', order_id='')
```
## Reference
Raw data
{
"_id": null,
"home_page": "https://github.com/phymach",
"name": "kgiapp",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.11",
"maintainer_email": null,
"keywords": "stock, futures, option, TWSE, TPEX, TAIFEX",
"author": "Leo Wu",
"author_email": "phymach@gmail.com",
"download_url": null,
"platform": "Windows",
"description": "# kgiapp\r\n\r\n![PyPI](https://img.shields.io/pypi/v/kgiapp)\r\n![PyPI - Python Version](https://img.shields.io/pypi/pyversions/kgiapp)\r\n![PyPI - Format](https://img.shields.io/pypi/format/kgiapp)\r\n![PyPI - License](https://img.shields.io/pypi/l/kgiapp)\r\n![PyPI - Downloads](https://img.shields.io/pypi/dm/kgiapp)\r\n![contact](https://img.shields.io/badge/\u51f1\u57fa\u8b49\u5238)\r\n\r\n\u51f1\u57fa\u8b49\u5238\u7a0b\u5f0f\u4e0b\u55aeAPI\u6574\u5408\u4e86.net framework 4.5\u67b6\u69cb\u4e0b\u7684\u4ea4\u6613\u4ecb\u9762\uff0c\u8b93\u4f7f\u7528\u8005\u53ef\u4ee5\u8f15\u9b06\u7684\u904b\u7528python\u57f7\u884c\u5feb\u901f\u4e0b\u55ae\u3002\r\n\r\n>kgiapp is a securities, futures, option API, which send orders to Concord Securities Group.\r\nThis package integrated with .net framework 4.5, and is compatible with Python 3.5+.\r\nIt is distributed under the MIT license.\r\n\r\n- [Installation](#installation)\r\n - [Preinstall](#preinstall)\r\n - [Binaries](#binaries)\r\n- [Quick Starts](#quick-starts)\r\n - [Login](#login)\r\n- [Place Order](#place-order)\r\n - [Stock](#stock)\r\n - [Futures](#futures)\r\n - [Foreign Futures](#foreign-futures)\r\n- [Register Event](#register-event)\r\n- [Quote](#quote)\r\n- [Reference](#reference)\r\n\r\n\r\n## Installation\r\n### Preinstall\r\n>API usage needs application in advance. In order to use this package, please contact us.\r\n\r\n### Binaries\r\n\r\nsimply use pip to install\r\n```\r\npip install kgiapp\r\n```\r\n\r\n## Quick Starts\r\n### Login\r\n```python\r\nfrom kgiapp import TradeAPI\r\n\r\nagent = TradeAPI(debug=False)\r\nagent.login(\"YOUR_PERSON_ID\", \"YOUR_PASSWORD\")\r\n```\r\n\r\n## Place Order\r\n### Stock\r\n```python\r\nfrom kgiapp.Trade import constant\r\n\r\nagent.stock_order(action=SecurityAction.NEW_ORDER, broker_no='YOUR_BROKER_NO', account_no='YOUR_ACCOUNT', lot_type=LotType.ROUND_LOT, order_type=OrderType.ORDINARY, \r\n side=Side.BUY, symbol='2330', quantity=1, price=570, price_flag=SecurityPriceFlag.FIX, time_in_force=TimeInForce.ROD, sub_account_no='', agent_id='', order_id='')\r\n\r\n```\r\n### Futures\r\n```python\r\nagent.futures_order(action=Action.NEW_ORDER, branch_no='YOUR_BROKER_NO', account_no='YOUR_ACCOUNT', sub_account_no='', market_type=Market.FUTURES, tb_20_code='MXFB1',\r\n time_in_force=TimeInForce.ROD, writeoff=WriteOff.OPEN, order_type=PriceFlag.LIMIT, side=Side.BUY, quantity=1, price=15100, web_id='', orig_net_no='', order_id='')\r\n\r\n\r\n```\r\n\r\n\r\n\r\n## Reference\r\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Python client for send order to KGI Securities.",
"version": "2.0.4",
"project_urls": {
"Homepage": "https://github.com/phymach"
},
"split_keywords": [
"stock",
" futures",
" option",
" twse",
" tpex",
" taifex"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "6e84dd39e8e43d9f9b5fcce426f92b606fd4b02b2f376e32e05acd8eb33417f6",
"md5": "698cf479643878d7cfaea9d925eb17a3",
"sha256": "9d82f8114d7b5e22886f0aa5e610d697715528bd5992ceb673ca37072dd30f2d"
},
"downloads": -1,
"filename": "kgiapp-2.0.4-cp311-cp311-win_amd64.whl",
"has_sig": false,
"md5_digest": "698cf479643878d7cfaea9d925eb17a3",
"packagetype": "bdist_wheel",
"python_version": "cp311",
"requires_python": ">=3.11",
"size": 681154,
"upload_time": "2024-11-17T14:56:04",
"upload_time_iso_8601": "2024-11-17T14:56:04.254590Z",
"url": "https://files.pythonhosted.org/packages/6e/84/dd39e8e43d9f9b5fcce426f92b606fd4b02b2f376e32e05acd8eb33417f6/kgiapp-2.0.4-cp311-cp311-win_amd64.whl",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-11-17 14:56:04",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "kgiapp"
}