In protected override void OnBarUpdate()
I have the following code which generates the error:
if ((entryOrder1 == null) && (entryOrder2 != null) && (entryOrder3 == null) && (SFlag == true) && (tradeflag == true) && (stopflag == false))
{ // Enter Short Order Filled and assigned to entryOrder2: SubmitOrderUnmanaged(0, OrderAction.Sell, OrderType.Limit, Quantity, aPrice, 0, "", "Enter Short");
askincr = TickDistanceAsk * TickSize;
bidincr = TickDistanceBid * TickSize;
askPrice = GetCurrentAsk(0);
bidPrice = GetCurrentBid(0);
aPrice = askPrice + askincr;
bPrice = bidPrice - bidincr;
ssPrice = aPrice + (TickDistanceStop * TickSize);
SubmitOrderUnmanaged(0, OrderAction.Buy, OrderType.Limit, Quantity, 0, ssPrice, "", "Enter SStop");
stopflag = true;
Print("Detection of Short Order Filled: entryOrder3 is:" + entryOrder3);
Print("Detection of Short Order Filled: entryOrder2 is: " + entryOrder2);
}
Since ssPrice is greater than bidPrice, and the same error is generated by Strategy when OrderType is set to StopLimit, I don't know what I'm doing syntactically for this error to happen when my other limit order is filled. Please guide me. Thank you very much.
Comment