当前位置: 首页>>代码示例>>Python>>正文


Python Contract.m_currenct方法代码示例

本文整理汇总了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
开发者ID:lulzzz,项目名称:AlgoTradingPlatform_Beta,代码行数:26,代码来源:ib_execution.py


注:本文中的ib.ext.Contract.Contract.m_currenct方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。