本文整理汇总了Python中ib.ext.Contract.Contract.m_primaryExchange方法的典型用法代码示例。如果您正苦于以下问题:Python Contract.m_primaryExchange方法的具体用法?Python Contract.m_primaryExchange怎么用?Python Contract.m_primaryExchange使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ib.ext.Contract.Contract
的用法示例。
在下文中一共展示了Contract.m_primaryExchange方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: newContract
# 需要导入模块: from ib.ext.Contract import Contract [as 别名]
# 或者: from ib.ext.Contract.Contract import m_primaryExchange [as 别名]
def newContract(symbol, sec_type, exch='SMART', prim_exch='SMART', curr='USD',
expiry=None, strike=None, opt_type=None):
contract = Contract()
contract.m_symbol = symbol
contract.m_secType = sec_type
contract.m_expiry = expiry
contract.m_strike = strike
contract.m_right = opt_type
contract.m_exchange = exch
contract.m_primaryExchange = prim_exch
contract.m_currency = curr
return contract
示例2: newContract
# 需要导入模块: from ib.ext.Contract import Contract [as 别名]
# 或者: from ib.ext.Contract.Contract import m_primaryExchange [as 别名]
def newContract(symbol, secType, optType="", strike=0, expiry=""):
contract = Contract()
contract.m_symbol = symbol
contract.m_secType = secType
contract.m_exchange = "SMART"
contract.m_primaryExchange = "SMART"
contract.m_currency = "USD"
contract.m_expiry = expiry # dateString
contract.m_strike = float(strike)
contract.m_multiplier = 100
contract.m_right = optType
return contract