本文整理汇总了Python中ib.ext.Contract.Contract.m_currenct方法的典型用法代码示例。如果您正苦于以下问题:Python Contract.m_currenct方法的具体用法?Python Contract.m_currenct怎么用?Python Contract.m_currenct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ib.ext.Contract.Contract
的用法示例。
在下文中一共展示了Contract.m_currenct方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: create_contract
# 需要导入模块: from ib.ext.Contract import Contract [as 别名]
# 或者: from ib.ext.Contract.Contract import m_currenct [as 别名]
def create_contract(self, symbol, sec_type, exch, prim_exch, curr):
"""
In order to actually transact a trade it is necessary to create an IbPy
Contract instance and then pair it with an IbPy Order instance which
will be sent to the IB API.
This method creates a Contract object defining what will be purchased, at which
exchange and in which currency.
Parameters:
symbol - The ticker symbol for the contract
sec_type - The security type for the contract ('STK' is 'stock')
exch - The exchange to carry out the contract on
prim_exch - The primary exchange to carry out the contract on
curr - The currency in which to purchase the contract
"""
contract = Contract()
contract.m_symbol = symbol
contract.m_secType = sec_type
contract.m_exchange = exch
contract.m_primaryExch = prim_exch
contract.m_currenct = curr
return contract