本文整理汇总了Python中ib.ext.Order.Order.m_permid方法的典型用法代码示例。如果您正苦于以下问题:Python Order.m_permid方法的具体用法?Python Order.m_permid怎么用?Python Order.m_permid使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ib.ext.Order.Order
的用法示例。
在下文中一共展示了Order.m_permid方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: makeOptOrder
# 需要导入模块: from ib.ext.Order import Order [as 别名]
# 或者: from ib.ext.Order.Order import m_permid [as 别名]
def makeOptOrder(action, orderID, tif, orderType):
newOptOrder = Order()
newOptOrder.m_orderId = orderID
newOptOrder.m_clientId = 0
newOptOrder.m_permid = 0
newOptOrder.m_action = action
newOptOrder.m_lmtPrice = 0
newOptOrder.m_auxPrice = 0
newOptOrder.m_tif = tif
newOptOrder.m_transmit = False
newOptOrder.m_orderType = orderType
newOptOrder.m_totalQuantity = 1
return newOptOrder
示例2: makeFutOrder
# 需要导入模块: from ib.ext.Order import Order [as 别名]
# 或者: from ib.ext.Order.Order import m_permid [as 别名]
def makeFutOrder(type, action, orderId=-99, price=None):
order = Order()
order.m_orderId = orderId
order.m_clientId = 0
order.m_permid = 0
order.m_orderType = type
order.m_action = action
order.m_minQty = 1
order.m_totalQuantity = 1
# order.m_transmit = False
if type == 'LMT':
order.m_lmtPrice = price
if action == 'SELL':
pass
return order
示例3: addmktorder
# 需要导入模块: from ib.ext.Order import Order [as 别名]
# 或者: from ib.ext.Order.Order import m_permid [as 别名]
def addmktorder(cid, action, qty):
id = len(orders)
o = Order()
o.m_orderId = id
o.m_clientId = 0
o.m_permid = 0
o.m_action = action
o.m_lmtPrice = 0
o.m_auxPrice = 0
o.m_tif = 'DAY'
o.m_orderType = 'MKT'
o.m_totalQuantity = qty
o.m_transmit = True
orders.append([o, cid, qty, id])
con.placeOrder(id, contracts[cid], o)
position(cid)
pending(cid)
示例4: makeOrder
# 需要导入模块: from ib.ext.Order import Order [as 别名]
# 或者: from ib.ext.Order.Order import m_permid [as 别名]
def makeOrder(self, action, orderId, tif, orderType, price, transmit, parentId):
newOrder = Order()
newOrder.m_orderId = orderId
newOrder.m_transmit = transmit
newOrder.m_lmtPrice = price
newOrder.m_tif = tif
newOrder.m_action = action
newOrder.m_orderType = orderType
if parentId is not None:
newOrder.m_parentId = parentId
newOrder.m_hidden = False
newOrder.m_outsideRth = True
newOrder.m_clientId = 999
newOrder.m_permid = 0
if orderType == 'LMT':
newOrder.m_auxPrice = 0
elif orderType == 'STP' or orderType == 'MIT':
newOrder.m_auxPrice = price
newOrder.m_totalQuantity = 1
return newOrder