Python client for send order to KGI Securities.
Project description
kgiapp
凱基證券程式下單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
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
from kgiapp import TradeAPI
agent = TradeAPI(debug=False)
agent.login("YOUR_PERSON_ID", "YOUR_PASSWORD")
Place Order
Stock
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
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
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distribution
File details
Details for the file kgiapp-2.0.3-cp311-cp311-win_amd64.whl
.
File metadata
- Download URL: kgiapp-2.0.3-cp311-cp311-win_amd64.whl
- Upload date:
- Size: 681.1 kB
- Tags: CPython 3.11, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b1059ad9eddab386e527deb31bbb18677a1565a67cbc0bf60e2aff5ce6317ad8 |
|
MD5 | 6d36913ec18fb546adb947795c840b1c |
|
BLAKE2b-256 | 106b3a5efe970c771b059b539352b9b3ae53bf364ebc943d04b48b97f3ca09c1 |