Problems on buy at the first day's close price
Hi everyone! I am new to backtrader, and I am trying to implement the simplest BuyAndHold strategy.
I want to execute the buy order at the first close price using the daily SPY price, so I put 'self.buy()' under start() instead of nextstart(). But it turned out that the buy order did not get executed.
And then I added 'cerebro.broker.set_coc(True)', but the buy order was executed at the last day's close price.
I guess this is because it's not proper to execute your order in start(). Is there anyone who have more insights on this? And any approach or suggestion on buy at the first day's close price? Many thanks in advance!