Im using EnterShortStop() and EnterLongStop to enter positions. Sometimes when the market is moving fast my orders end up getting rejected even though it checks the bid or ask and the last before submitting the order.
code for checking the ask, last, and if its still in the same bar for long entry
if(High[2]+.02 > GetCurrentAsk()&& High[2]+.02 > High[0] && High[2]+.02 > Close[0]) { entryOrder = EnterLongStop(High[2]+.02, "EnterLong"); }
if(Low[2]-.02 < GetCurrentBid()&& Low[2]-.02 < Low[0] && Low[2]-.02 < Close[0]) { entryOrder = EnterShortStop(Low[2]-.02, "EnterShort"); }
Also im using OnOrderUpdate(IOrder order) and OnExecution(IExecution execution) for the order handling/ stops and targets.
Comment