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/

    Corporate actions

    General Code/Help
    3
    6
    851
    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.
    • spyamine
      spyamine last edited by

      Hi

      How can I account for corporate actions into my backrest? Like dividend payments, splits and bonus share...

      Many thanks

      1 Reply Last reply Reply Quote 0
      • A
        ab_trader last edited by

        I came in to the following approaches, quite common:

        • splits need to be considered in the data feed, prices should be adjusted.

        • dividends also can be considered in the prices (adjusted prices) if you don't use stop or limit orders. Easiest way probably.

        • if you use stop or limit orders, then you need to use non-adjusted prices. In this case indicator with dividends can be written, than these amounts can be added to broker cash.

        • other way to consider dividends is to write your own commissions, this was discussed here on the forum couple times.

        • If my answer helped, hit reputation up arrow at lower right corner of the post.
        • Python Debugging With Pdb
        • New to python and bt - check this out
        1 Reply Last reply Reply Quote 0
        • spyamine
          spyamine last edited by

          Thanks for you answer!! but in a sense if you work with adjusted prices, you are putting the future information into the past. It's like a look-ahead bias. so is there any other solution?

          plus if you have a historical portfolio and wanted to load it to backtrader. You historical orders are unadjusted. So it won't be possible to load it unless you modify your orders.

          Also, I'm wondering how the spanish fund has managed to use backtrader to manage a real fund if they did not account for the corporate actions. Do you have any idea how they did ?

          A 1 Reply Last reply Reply Quote 0
          • A
            ab_trader @spyamine last edited by ab_trader

            @spyamine said in Corporate actions:

            Thanks for you answer!! but in a sense if you work with adjusted prices, you are putting the future information into the past. It's like a look-ahead bias. so is there any other solution?

            I don't see any look ahead bias using adjusted prices. Common approach considering additional dividend income. If you don't mind, please elaborate.

            Other way with bt is to develop broker which simulate real operations.

            plus if you have a historical portfolio and wanted to load it to backtrader. You historical orders are unadjusted. So it won't be possible to load it unless you modify your orders.

            I've done this. I've adjusted size of position based on the split to achieve the same total position size. Got the same results for adjsuted and un-adjusted prices.

            Also, I'm wondering how the spanish fund has managed to use backtrader to manage a real fund if they did not account for the corporate actions. Do you have any idea how they did ?

            Adjusted prices I assume, this is a common way.

            • If my answer helped, hit reputation up arrow at lower right corner of the post.
            • Python Debugging With Pdb
            • New to python and bt - check this out
            1 Reply Last reply Reply Quote 0
            • spyamine
              spyamine last edited by

              Amen to that!!

              I'll try to find a post on quantopian that details the lookahead bias in the meantime

              1 Reply Last reply Reply Quote 0
              • Ahmed Malik
                Ahmed Malik last edited by

                I don't see any look ahead bias using https://vurse.com adjusted prices. Common approach considering additional dividend income. If you don't.

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