@traderone3 , Hi
I am interesting in the solution too. Can u show the full code example ?

Best posts made by artur.space
-
RE: Using Cheat on open and cheat on close together
Latest posts made by artur.space
-
RE: Using Cheat on open and cheat on close together
@traderone3 , Hi
I am interesting in the solution too. Can u show the full code example ? -
RE: Convincing strategy to buy at close of current bar in backtest
@backtrader said in Convincing strategy to buy at close of current bar in backtest:
The observer in charge of plotting only sees the notification in the next cycle.
Check the
order.executed.dt
field and you will see the order was properly executed on the right bar (even if the observer doesn't know it)@ab_trader said in Convincing strategy to buy at close of current bar in backtest:
The order is executed as required, it is just the plotting and it confuses a bit. I know the plotting is not the main goal of the backtrader, but sometimes visual check of the signals/executions is really helpful.
Hi. I faced the same issue. Does anybody know how to force the plotting to draw sell/buy signals in right place (with cheat-on-close mode enabled) ?
-
RE: bt for low-frequency / trend following trading
@backtrader said in bt for low-frequency / trend following trading:
You don't have any other approach if you want to operate before the close. You need to have the price updated before you operate.
Ok, and how can I get it? Alpaca live account isn't allowed for me. What API with paper-trading abilities should I use ?
-
RE: bt for low-frequency / trend following trading
@backtrader said in bt for low-frequency / trend following trading:
You obviously need to read the prices before the market opens and before it closes (even if you think that's not streaming). Alpaca has a broker for backtrader. You probably need to run it twice a day, but it still remains to be seen how you think you can do something pre-market close without having the intraday prices.
Thanks for the answer! I understand your points and they are reasonable. But I've tried this API and they provide access to intraday prices ONLY if you have live trading account. And it doesn't fit my possibilities, I wanted to try just paper-api. That's why I am searching for other approaches / APIs. Could you suggest any ?
-
bt for low-frequency / trend following trading
Does BT fit to low freq trading (for instance make 2 orders per day after exchange opens and before closing according to predictions, therefore I don't need any streaming price info) ? And if it does, should I create custom broker/store classes to connect with trade API (Alpaca for example)?