For code/output blocks: Use ``` (aka backtick or grave accent) in a single line before and after the block. See:

Interactive Brokers for orders only ,not for data feed

  • Hello,
    Is it possible to use IB for buy/sell orders (+portfolio status) but take the ticker data from a csv file ?
    Can I replace the ibstore.getdata(...) line with cerebro.adddata(...) line, in the following example?

        cerebro = bt.Cerebro()
        ibstore = bt.stores.IBStore(host='', port=1001, clientId=33,notifyall=True) = ibstore.getbroker()
        for ticker in ['AAPL', 'XOM']:
            ib_dataname = ticker+'-STK-SMART-USD'
            data = ibstore.getdata(dataname=ib_dataname,name=ticker,timeframe=bt.TimeFrame.Days,

    Thank you.

  • administrators

    Data feeds and brokers are independent.

    But you still need a contract reference for the Broker connecting to Interactive Brokers, to let it know what it is being bought and sold.

  • Hi and thank you for your reply,
    Can you elaborate what that means?

    Thank you

  • administrators

    The broker needs to know what is being bought and sold. Your csv based data feed is not a reference for anything when talking to Interactive Brokers. You need a data feed from Interactive Brokers, even if only for it to be the target of your order.

  • administrators

    Addtionally and taking into account that you are clearly developing software for a 3rd party and trying to get free information from the community, you could be the one actually elaborating your questions.

  • The software I develop is for my personal use only and I'm not trying to get anything for free,I have my own .csv files with up-to-date historical quotes which I would like to use as the data feed, while the bt-ib interface is not working smoothly,this is why I wanted to know if I may use the up-to-date csv file as datafeed while leaving the bt-ib interface for orders and portfolio status,I have done this before with C++ TWS interface and it worked fine.