Incomplete Bracket Order (TP set later)
In my algorithm, I can set the TP only when my buy/sell limit has been filled. More specifically, the tp only can be calculated when the current market price is around the buy/sell limit price.
I am using a code like the following to implement this. But the target does not work this way.
How to combine indicators of different timeframes
Can you tell me why an error occurs when establish a coupling between indicators that operate on datas with different timeframes
Access the main plot axis in backtrader
I wand to add custom plot elements e.g. a box between buy and sell trades. The axis ax is normally created like this: fig, ax = plt.subplots()
How can I access it in Backtester’s plot?
How to add min period in strategy?
In most cases we add min period in Indicators and in strategy’s next(), everything is handled properly. But sometimes the strategy is extremely simple so that I don’t want to write a indicator for it. In this case how can I mannully add a min period in strategy? Of course, I can create a dummy indicator in strategy’s __init__
but this seems not elegant at all. I’m considering is there exist any elegant method?
Why should not call super(ClassName, self).__init__() in derived class‘s construction function?
I’ve noticed that every examples and docs and references about backtrader never call super(ClassName, self).init() in derived class’s construction function, which is different from common use. For example, when I want to define a custom Module in Pytorch, it would look like: