interactive_brokers_price_handler.py 文件源码

python
阅读 30 收藏 0 点赞 0 评论 0

项目:Odin 作者: JamesBrofos 项目源码 文件源码
def request_prices(self, current_date, symbols):
        """Implementation of abstract base class method."""
        # Reset the bar object for the latest assets requested.
        self.bar = pd.Panel(
            items=[PriceFields.current_price.value], major_axis=[current_date],
            minor_axis=symbols
        )
        # Issue requests to Interactive Brokers for the latest price data of
        # each asset in the list of bars.
        for i, s in enumerate(symbols):
            c = self.create_contract(s)
            self.conn.reqMktData(i, c, "", True)

        # Wait a moment.
        sleep(0.5)

        return self.bar
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号