InvalidPrice error that stops my strategy

My strategy has code for a breakeven situation where, for example, it gets to the entry price +5 points and it then moves SL to entry +2. I’ve had situations where if there’s a sudden move in the opposite direction, the SL isn’t accepted.

That’s fine, but I get an error message like the below and then the strategy terminates.

I’d be happy that the SL didn’t set and then have another go at setting it when entry +5 is reached again, but with the strategy terminated I’m stuck.

Other platforms just say ‘no can do’ and carry on. Surely NT should be able to do that.
Am I missing something in my strategy that would make it tolerate such conditions?

Maybe have a wider stop? Your stop is too tight once it goes into profit. It could come back before your stop is even set. If you still want this then you should just programmatically track it instead of using an OCO. I wouldn’t though because you’ll most likely get stopped out most of the time.

That’s exactly the problem - it’s coming back and hitting before the SL is set.
This is a Proof of Concept piece, but my point is why does NT crash.

Whatever my numbers, practically this could happen in real-life and NT just stops.

That said, I have just found a line that I can add to my code that will, hopefully, allow the strategy to continue on.

RealtimeErrorHandling = RealtimeErrorHandling.IgnoreAllErrors;

I’ll see how that goes in my testing.