SmartQuant Discussion

Automated Quantitative Strategy Development, SmartQuant Product Discussion and Technical Support Forums
It is currently Wed Aug 21, 2019 5:36 pm

All times are UTC + 3 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Tue Feb 09, 2010 8:17 pm 
Offline

Joined: Fri Feb 27, 2009 10:25 pm
Posts: 3
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 ***


Top
 Profile  
 
PostPosted: Tue Feb 09, 2010 9:50 pm 
Offline

Joined: Fri Feb 27, 2009 10:25 pm
Posts: 3
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 ****


Top
 Profile  
 
 Post subject:
PostPosted: Wed Feb 10, 2010 12:34 pm 
Offline
Site Admin

Joined: Thu Jul 17, 2003 10:39 am
Posts: 1478
Hi,

It's hard to reproduce such issue on our side.
Do you have some steps for doing it? Or could you send me sample strategy?

Regards,
Alex

_________________
SmartQuant Development Team


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC + 3 hours


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group