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/

    Backtesting options using intraday OHLC data on backtrader.

    General Code/Help
    2
    2
    212
    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.
    • A
      am_trade last edited by

      Firstly thank you for this awesome library. This is the most flexible open source library I have seen on the internet for backtesting.

      I was planning on using backtrader for options backtesting. I understand that rolling over to new expirations won't be easy but what I was thinking is just adding all the strike options data feeds as different asset classes into the Cerebro PLUS the underlying data feed to get intraday signals.

      example:

      data feed 0: Underlying assets 1 minute data (OHLC intraday 1 minute data available)
      data feed 1-20: Call options for 20 strikes for May monthly expiration 1 minute data . (OHLC intraday 1 minute data available of only when trades were placed)
      data feed 21-40: Put options for 20 strikes for May monthly expiration 1 minute data. (OHLC intraday 1 minute data available of only when trades were placed)

      Based on data feed 0 I generate long or short signals.

      Long signal means I buy the first out of the money call option at market i.e. buy 1 of the data feeds from 1 to 20 and close the position when sell signal comes.
      Short signal means I buy the first out of the money put option at market i.e. buy 1 of the data feeds from 21 to 40 and close the position when sell signal comes.

      No position sizing involved for now. Just an all in all out strategy.
      Does anyone has sample code for something like that or anything else that gets the job done for me?
      It would be great if someone can help me with this and I genuinely believe something like that will help a lot of people in the future.
      I am sorry if I have missed anything in the documentation.
      Even a base use case code would also be great if you could post it here.

      email ID: algobot12@gmail.com

      1 Reply Last reply Reply Quote 0
      • run-out
        run-out last edited by

        Have a look at this response. https://community.backtrader.com/topic/1115/is-anyone-successfully-backtesting-options-with-backtrader/4

        1 Reply Last reply Reply Quote 0
        • 1 / 1
        • First post
          Last post
        Copyright © 2016, 2017, 2018 NodeBB Forums | Contributors
        $(document).ready(function () { app.coldLoad(); }); }