Corporate actions
-
Hi
How can I account for corporate actions into my backrest? Like dividend payments, splits and bonus share...
Many thanks
-
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.
-
-
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 ?
-
@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.
-
Amen to that!!
I'll try to find a post on quantopian that details the lookahead bias in the meantime