I'm having a problem with an strategy cancelling Limit orders, and I don't know how to sort it out.
On OnBarUpdate, if entry conditions are met I execute:
SetProfitTarget("", CalculationMode.Price, priceTarget);
SetStopLoss("", CalculationMode.Price, priceStopLoss, false);
PacManEntryPrice = priceIn + 5 * TickSize;
EnterShortLimit(p032NumContractesPacMan, PacManEntryPrice, "PACMAN");
DrawTriangleUp("pacman"+CurrentBar,true,0,PacManEn tryPrice,Color.Blue);
The problem comes because the order is valid of 1 bar only, then gets cancelled :-(.
What should I do to have this order valid until it is cancelled by the strategy decision?
Following is an example taken from output
17/01/2014 15:01:21 Entered internal SetStopTarget() method: Type=Target FromEntrySignal='' Mode=Price Value=9726 Currency=0 Simulated=False
17/01/2014 15:01:21 Entered internal SetStopTarget() method: Type=Stop FromEntrySignal='' Mode=Price Value=9764,5 Currency=0 Simulated=False
17/01/2014 15:01:21 Entered internal PlaceOrder() method at 17/01/2014 15:01:21: BarsInProgress=0 Action=SellShort OrderType=Limit Quantity=1 LimitPrice=9747,0 StopPrice=0 SignalName='PACMAN' FromEntrySignal=''
17/01/2014 15:01:21 Cancelled expired order: BarsInProgress=0: Order='NT-00043/Sim101' Name='PACMAN' State=Working Instrument='FDAX ##-##' Action=SellShort Limit price=9747 Stop price=0 Quantity=1 Strategy='SB_AneuACagar_v1_06' Type=Limit Tif=Gtc Oco='' Filled=0 Fill price=0 Token='bf85283bc61c4086b9a6d19a0ad23cfd' Gtd='01/12/2099 0:00:00'
Thanks!
Pak
Comment