I am trying to submit two EnterStopLimitOrders simultaneously one to buy above the market and one to sell below when certain conditions are met. I also want the orders to be cancelled within a couple of bars if orders are not executed, or when one of the orders is executed.
The problem when I run this, is only one order is submitted not 2, in the Log I get a message ‘An Enter() method to submit an order has been ignored’
Any idea where I am going wrong?
Thanks
private IOrder myEntryOrder1 = null;
private IOrder myEntryOrder2 = null;
privateint barNumberOfOrder = 0;
if # my conditions #
&& myEntryOrder1 == null
&& myEntryOrder2 == null)
{
myEntryOrder1 = EnterLongStopLimit(0, true, 1, 3, 1, "Buy");
myEntryOrder2 = EnterShortStopLimit(0, true, 1, -3, -1, "Sell");
barNumberOfOrder = CurrentBar;
}
Comment