Need clarification on cheating/replay/timers to buy at open and sell minutes before it closes
So on the 1H chart, I am just trying to buy when a candle opens and sell 5 minutes before it closes.
I've read some docs:
But I kinda need an ELI5 and clarification on what they do.
To buy at the open, it sounds like
cheat-on-openmight be what I want. From what I understand, by default things operate on
next()when candles close and indicators are recalculated, so it's "cheating" if you try to do something before the complete close of the current candle, so you only have the previous candle close to work with at the open of the current candle, and you don't know where that opening current candle will end up. Am I understanding this correctly?
Also I'm not sure of the difference between
replay, but it sounds like 'replay' might be along the lines of what I want. I also saw that I can add timers. To sell 5 minutes before a candle closes, should I use
Um, this may also be relevant: https://www.backtrader.com/docu/filters-reference/#barreplayer_open