ariliveitup wrote:
I am experiencing strange behavior in my backtest. At times, I will send out a StopLossOrder for Profit Target / Stop Loss and it will be filled when the market reaches the price.
See Order 1 below
On other other hand, sometimes StopLossOrder gets rejected and does not execute even though StopLoss level has been reached and the order is rejected.
See Order 2 below
How can I resolve this issue?
Order1 [VS debugger]
Account "" string
AvgPrice 1112.75 double
CumQty 1.0 double
+ DateTime {12/21/2009 10:04:00 AM} System.DateTime
+ ExpireTime {1/1/0001 12:00:00 AM} System.DateTime
+ IB {OpenQuant.API.IBEx} OpenQuant.API.IBEx
+ Instrument {ES Dec-Jan2010} OpenQuant.API.Instrument
IsCancelled false bool
IsDone true bool
IsFilled true bool
IsNew false bool
IsPartiallyFilled false bool
IsPendingCancel false bool
IsPendingNew false bool
IsPendingReplace false bool
IsRejected false bool
LastPrice 1112.75 double
LastQty 1.0 double
LeavesQty 0.0 double
OCAGroup "OCA ES Dec-Jan20101" string
Price 1112.75 double
Qty 1.0 double
Side Sell OpenQuant.API.OrderSide
Status Filled OpenQuant.API.OrderStatus
StopPrice 1112.75 double
StrategyFill false bool
StrategyPrice 0.0 double
Text "Profit Target: Swing Bottom" string
TimeInForce Day OpenQuant.API.TimeInForce
TrailingAmt 0.0 double
Type StopLimit OpenQuant.API.OrderType
Order 2[VS Debuggeer]
Account "" string
AvgPrice 0.0 double
CumQty 0.0 double
+ DateTime {12/21/2009 1:43:00 PM} System.DateTime
+ ExpireTime {1/1/0001 12:00:00 AM} System.DateTime
+ IB {OpenQuant.API.IBEx} OpenQuant.API.IBEx
+ Instrument {ES Dec-Jan2010} OpenQuant.API.Instrument
IsCancelled false bool
IsDone true bool
IsFilled false bool
IsNew false bool
IsPartiallyFilled false bool
IsPendingCancel false bool
IsPendingNew false bool
IsPendingReplace false bool
IsRejected true bool
LastPrice 0.0 double
LastQty 0.0 double
LeavesQty 0.0 double
OCAGroup "OCA ES Dec-Jan20100" string
Price 1106.0 double
Qty 1.0 double
Side Buy OpenQuant.API.OrderSide
Status Rejected OpenQuant.API.OrderStatus
StopPrice 1106.0 double
StrategyFill false bool
StrategyPrice 0.0 double
Text "Profit Target: Double Top" string
TimeInForce Day OpenQuant.API.TimeInForce
TrailingAmt 0.0 double
Type StopLimit OpenQuant.API.OrderType
*** This snapshot is from running a backtest and not live ***
*** For Order2 stop level was reached however not executed and was rejected ***
*** I experience this issue on StopLimit and Stop Orders both ****