@backtrader said in Backtrader DOES NOT CRASH on MOO orders - The USER CODE does:
Use next where guarantees are valid.
I tried this before using prenext. next is not called as securities are not traded, so there not enough bars I guess. For some securities there is no trading happening at all. Does it mean that for them it's not possible to create orders before market open?
@MarkWhatson answering your initial question - you need to add conditions for your force selling to __init__ or next() and then issue corresponding orders in the next(). This is all I can say based on what was shown here.