|
Netherlands
Posts: 10 since Feb 2011
Thanks Given: 0
Thanks Received: 0
|
I am working on a strategy that can be used with multiple contracts.
It is using limitorders and when they are not filled, a condition must cancel them.
The problem is: only one contract is cancelled, see below.
//Entering Trades
if (Contracts==2) {entryOrderLong = EnterLongLimit(0,true,1,BuyPrice1,"EL1");entryOrderLong = EnterLongLimit)0,true,1,BuyPrice1,"EL2");}
//Cancelorders
if (Position.MarketPosition == MarketPosition.Flat && entryOrderLong != null && Close[0]>=CancelPrice)
{
CancelOrder(entryOrderLong);
}
How do I get both contracts cancelled?
|