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
Release history Release notifications | RSS feed
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.1-cp311-cp311-win_amd64.whl
.
File metadata
- Download URL: kgiapp-2.0.1-cp311-cp311-win_amd64.whl
- Upload date:
- Size: 681.0 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 | 45f37d7d9490d0124bc0228d2d131b2d717556aa95b8794407fc148a2c546f20 |
|
MD5 | de90ae98ae5da59f44756d6de4e523e7 |
|
BLAKE2b-256 | 90f6f778527d74e6a7b7a6a88234772414eac0a75d7aad9bae7963929a3ae82f |