Open joeledwardson opened 3 years ago
I think I have found the bug: in FlumineBacktest._process_backtest_orders()
, it has
if order.trade.status.value == "Complete":
blotter.complete_order(order)
However, if a Trade
has one complete Order
then its status will go to Complete
, and only after a new Order
has been placed will the Trade
status go back to LIVE
, at which point the blotter has already deemed the Order
as Complete
I have come across an unusual bug: When backtesting, if a situation is created for a historical event where:
Trade
created, backOrder
created with tradeOrder
reachesEXECUTION_COMPLETE
Trade
created, layOrder
created with new tradeOrder
reachesEXECUTION_COMPLETE
However, if this is exact same execution is modified so that in step 3. the lay
Order
is created with the sameTrade
used in step 1. for the backOrder
, then the layOrder
never reachesEXECUTION_COMPLETE
?