For code/output blocks: Use ``` (aka backtick or grave accent) in a single line before and after the block. See:

Live Feed vs Backtesting

  • Hi, I'm just learning about backtrader and I have some questions regarding how the program processes backtesting as opposed to live trading (in my case, Interactive Brokers).
    First off, I'm not sure if backtrader's buy and sell orders sell at the candle's close or not. For example: if a candle has an OHLC of (30,31,28,29) will the code automatically sell at 29 when it's done processing?
    In addition to this, while in live trading, will the program wait till the candle is fully formed before making orders or as the live data feed is coming in for that same candle, the 'next' function keeps getting iterated. If the latter is the case, then how does that work? Sorry if this seems a bit confusing. If it is, please let me know so I can clarify any way I can. Thanks