Navigation

    Backtrader Community

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    For code/output blocks: Use ``` (aka backtick or grave accent) in a single line before and after the block. See: http://commonmark.org/help/

    Interactive Brokers Options Trading HLOC DataFeed

    General Code/Help
    3
    4
    236
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • alexbrillant
      alexbrillant last edited by

      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 !

      1 Reply Last reply Reply Quote 0
      • alexbrillant
        alexbrillant last edited by

        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)

        1 Reply Last reply Reply Quote 0
        • S
          shspersonalwork last edited by

          Did this work for you?

          1 Reply Last reply Reply Quote 0
          • C
            chewbacca last edited by

            @alexbrillant the YYYYMM format for Futures is incorrect, it needs to be YYYYMMDD

            1 Reply Last reply Reply Quote 0
            • 1 / 1
            • First post
              Last post
            Copyright © 2016, 2017, 2018, 2019, 2020, 2021 NodeBB Forums | Contributors