check if an order would be accepted before its created
Bayne last edited by Bayne
Hey Coders and Backtrader supporters,
Is there an inbuilt function to check if an order would be accepted (without sending it?)
Otherwise, if i want to build such an order, (only for backtesting purposes), what should it check else but the margin? (+ any tips how to get the current margin)
I need to send Takeprofit and stoploss at the same time as the main ordercreation to get reliable backtesting results
(e.g. if the order is completed and the TP & SL are beeing sent but the current HighPrice hits the level where the unexecuted TP will be (which gets executed at the next bar)
You have to manually check it, just like in real life. But your approach doesn't have the goal to achieve reliable backtesting results. Quite the opposite.
Bayne last edited by
@backtrader yes and what else but the margin do i need to check in this case?