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

Interactive Brokers Options Trading HLOC DataFeed

  • Hello backtrader community !

    I am trying to implement a data feed for option contracts.
    I would like to simply create a datafeed for a specific option contract.
    I would like to be able to buy, and sell that contract.

    From what I understood, I can trade options as an HLOC datafeed. What classe should I extend from ? Is there a more abstract class ? Should I extend this ?

    class OptionDataFeed(with_metaclass(MetaDataBase, dataseries.OHLCDateTime)):
         # should I do this ?

    Another question, how can I actually buy this option contract/datafeed ?

    I think that this is not included in the library. I am willing to submit a pull request if you guys want that feature for ib. However, I would like to know how this should be done with this library.

    Thanks !

  • found the answer ! this is how you get an option data feed. you pass in the contract with the format specified below !

    option_data_feed = ibstore.getdata('TICKER-OPT-EXCHANGE-CURRENCY-YYYYMMDD-STRIKE-RIGHT')

    I don't know if this works yet. Let's see. I need to get the option chain from the ib api.

    Screen Shot 2020-07-07 at 9.10.54 PM.png image url)

Log in to reply