I have advanced to the point where I can create and cancel orders programmatically, and am getting my management structure built piece-by-piece. In my latest bit of testing, however, I am getting an error that, on its face, is complete nonsense, and therefore cannot possibly be fixed.
The script has just executed a short entry, and OnOrderUpdate has identified the fill and attempted to create the SL and TP orders for this position. As they are both linked by an OCO ID, neither was successfully submitted because the rejection of this one caused the cancellation of the other.
That part makes sense, but none of it really does because the error is telling me that a Stop Limit Buy order cannot be placed below market, but, as you can see, the limit price is far above the current price. Price hasn’t even come anywhere near that price in the current candle.
So, how do I fix it when there is nothing wrong?
