Skip to main content

Python client for send order to KGI Securities.

Project description

kgiapp

PyPI PyPI - Python Version PyPI - Format PyPI - License PyPI - Downloads contact

凱基證券程式下單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 Distribution

kgiapp-2.0.2.tar.gz (680.9 kB view details)

Uploaded Source

Built Distribution

kgiapp-2.0.2-cp311-cp311-win_amd64.whl (681.1 kB view details)

Uploaded CPython 3.11 Windows x86-64

File details

Details for the file kgiapp-2.0.2.tar.gz.

File metadata

  • Download URL: kgiapp-2.0.2.tar.gz
  • Upload date:
  • Size: 680.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.2

File hashes

Hashes for kgiapp-2.0.2.tar.gz
Algorithm Hash digest
SHA256 238152cb17d347823795ac363e1c3d08f55a0822032829f0a3a1566da2d1e274
MD5 0e541cc7d53b8b84a40a0c1049c6ba6f
BLAKE2b-256 dff66a497e8d46242c83a05a04c0b75aad3518563c65d8772988e49a262586e9

See more details on using hashes here.

File details

Details for the file kgiapp-2.0.2-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: kgiapp-2.0.2-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

Hashes for kgiapp-2.0.2-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 307a0b5813a4d07f86e477c76454214c4cab2b143c56c7be28c8d825cfdb38c2
MD5 dbee9fd8ece6a0a00a64dfc72a6bbb61
BLAKE2b-256 16ac901152258bce035a8b4840d33e48a0c9f966717432eeaef7578034449750

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page