Make ticks on edges count as open for next bar (instead of close of current bar)
vbs last edited by
I am back at this topic (everyhing I say is based on my current understanding, please feel to comment if I am wrong somewhere):
When resampling ticks to a higher timeframe then currently backtrader counts ticks on the edge (e.g.
Hour) as last (closing) value for the current bar. This intentionally as far as I know.
I was expeceting (since I know it from other software packages) that such ticks would count as the open value for the following bar.
I had a topic about this here already (I thought it was a bug back then):
So I tried to change the backtrader code to make it behave like I am used to. I did it with this commit which touches backtrader's
The commit adds a parameter
False). When setting to
Truethen the alternative behavior is activated (only when resampling
Tick). So far it does what I wanted for me.
Please @backtrader would you maybe take a look at the commit and tell me if you see problems with that approach? I feel that I don't have a well enough understanding of the internals to be sure to avoid side effects. :(