inquantstudio quant open api
Project description
-- coding: utf-8 --
from iqsopenapi import *
if name == 'main':
"""测试"""
try:
api = StgyOpenApi("1",print,print,print,print,"d://logs/IQS.OpenApi.Python/")
api.Start()
sub = api.Subscribe([{'symbol':'rb2005','exchange':4,'marketType':'TICK','barType':0},{'symbol':'rb2005','exchange':4,'marketType':'BAR','barType':60}])
unSub = api.Unsubscribe([{'symbol':'rb2005','exchange':4,'marketType':'TICK','barType':60}])
subList = api.GetSubscribeList()
lastTick = api.GetLastTick("rb2005",Exchange.SHFE,1)
lastBar = api.GetLastBar('rb2005',Exchange.SHFE,5 * 60,1)
hisBar = api.GetHisBar('rb2005',Exchange.SHFE,5 * 60,20190101120000,20190101140000)
clientOrderId = uuid.uuid4().hex
sendOrder = api.SendOrder(clientOrderId,'rb2005',Exchange.SHFE,"B",2400,1,OrderType.MKT,Offset.Open,'测试')
cancelOrder = api.CancelOrder("1231231")
assetInfo = api.GetAssetInfo()
orders = api.GetOrders()
order = api.GetOrder(clientOrderId)
openOrders = api.GetOpenOrders()
positions = api.GetPositions()
contract = api.GetContract('rb2005',Exchange.SHFE)
except Exception as e:
print(e)
pass
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 Distribution
Built Distribution
Hashes for iqsopenapi-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7d300e9493db31302e63c3d63f7dde7bdd2d49fbf520e2ffb9e000b6866093ab |
|
MD5 | 63acb0ced49a4e52078ee52218256879 |
|
BLAKE2b-256 | 983e254738da2b66a350964cd0c999d899befe54c2964490b81ed8188b99b348 |