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.4-cp311-cp311-win_amd64.whl
.
File metadata
- Download URL: kgiapp-2.0.4-cp311-cp311-win_amd64.whl
- Upload date:
- Size: 681.2 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 | 9d82f8114d7b5e22886f0aa5e610d697715528bd5992ceb673ca37072dd30f2d |
|
MD5 | 698cf479643878d7cfaea9d925eb17a3 |
|
BLAKE2b-256 | 6e84dd39e8e43d9f9b5fcce426f92b606fd4b02b2f376e32e05acd8eb33417f6 |