SmartQuant Discussion

Automated Quantitative Strategy Development, SmartQuant Product Discussion and Technical Support Forums
It is currently Wed Dec 13, 2017 6:30 am

All times are UTC + 3 hours




Post new topic Reply to topic  [ 31 posts ]  Go to page 1, 2, 3  Next
Author Message
 Post subject: Wrong order fill
PostPosted: Thu Nov 06, 2014 3:06 pm 
Offline

Joined: Tue May 01, 2012 6:46 pm
Posts: 97
Hi Guys,

Faced with one very strange situation, please clarify.
http://grabilla.com/04b06-64092517-a410 ... d5c9e1.png
There were two buys 42.75 and 42.78. In OnPositionOpened() i have placed two SellSstop orders:
11:41:26.13 LEN Set Stop0 Sell 209 42.45
11:41:26.14 LEN Set Stop1 Sell 209 42.45

and as you can see in screenshot in about hour one of these stops filled by 101.52
how's it can be possible?

execution = IB; market data = iqfeed

IB TWS hasnt filled this order which is correct:
http://grabilla.com/04b06-5b4dc45e-b59f ... 43e329.png
you can see in trade log only buys, no stops. also you can see not filled orders in portfolio

iqfeed also hasn't 101.52 quote:
http://grabilla.com/04b06-73f9103e-0a16 ... e82624.png

please check what is wrong and how it can be fixed.

Thanks,
Ivan


Top
 Profile  
 
 Post subject: Re: Wrong order fill
PostPosted: Thu Nov 06, 2014 3:43 pm 
Offline
Site Admin

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

Is logging enabled of IB plugin? In such case we could try to find a reason of the wrong fill.
At 12.55 I see the fills for QQQ at 101.52
It is possible that IB or order manager have put these fills into the wrong order.

_________________
SmartQuant Development Team


Top
 Profile  
 
 Post subject: Re: Wrong order fill
PostPosted: Thu Nov 06, 2014 3:55 pm 
Offline

Joined: Tue May 01, 2012 6:46 pm
Posts: 97
Thanks Alexei.

will check the logs. but please let me know how i can check if logs enabled and were logs located

Ivan


Top
 Profile  
 
 Post subject: Re: Wrong order fill
PostPosted: Thu Nov 06, 2014 5:46 pm 
Offline
Site Admin

Joined: Thu Jul 17, 2003 10:39 am
Posts: 1478
Please, find LoggingEnabled property of IB plugin in the PropertiesWindow.
Also, there are some other options to customize the logging.
Log files are called ib-yyyyMMdd.txt and are located in
C:\Users\<user>\AppData\Roaming\SmartQuant Ltd\OpenQuant\Framework\logs directory.

_________________
SmartQuant Development Team


Top
 Profile  
 
 Post subject: Re: Wrong order fill
PostPosted: Thu Nov 06, 2014 6:51 pm 
Offline

Joined: Tue May 01, 2012 6:46 pm
Posts: 97
http://grabilla.com/04b06-5ea82796-23aa ... e698b1.png
if you mean Logging -> Settings -> Enabled then it = False in my case; and yesterday it was also False;
what we can research without logging?


Top
 Profile  
 
 Post subject: Re: Wrong order fill
PostPosted: Thu Nov 06, 2014 8:06 pm 
Offline
Site Admin

Joined: Thu Jul 17, 2003 10:39 am
Posts: 1478
Yes, I meant this option.
This is the best way to find plugin's logic error in its logs.
Well, if there is no log, we could try to investigate the problem by another way.
Do you run the strategy in Live mode with Persistent flag set?
Could you look into the OrderManager window and check for the status of these stop orders,
and also what happens with the order for QQQ.

_________________
SmartQuant Development Team


Top
 Profile  
 
 Post subject: Re: Wrong order fill
PostPosted: Fri Nov 07, 2014 4:53 pm 
Offline

Joined: Tue May 01, 2012 6:46 pm
Posts: 97
Yes, it was Persistent but unfortunately i have already restarted strategy without persistent (btw because of this problem - it corrupted my performance/portfolio with incorrect +$17k),
so now LEN and QQQ orders vanished.


Top
 Profile  
 
 Post subject: Re: Wrong order fill
PostPosted: Thu Nov 13, 2014 7:23 pm 
Offline

Joined: Tue May 01, 2012 6:46 pm
Posts: 97
Hi Alexei,

same problem again.
http://grabilla.com/04b0d-4f26c8db-b575 ... 6dde56.png
http://grabilla.com/04b0d-c95bc1e1-6155 ... 7c2dd7.png

as you see ARW in OQ filled by 204.77 - same price as for Market order for SPY

here is this stop order: the selected one (9:40:01 AM ARW Buy Stop 58 shares)
http://grabilla.com/04b0d-25f95876-4e9d ... 87d080.png

ARW is trading from OQ
SPY is trading manually (not from OQ)

please let me know what additional info do you need to check this issue

sorry logs for IB plugin are still disabled as i have already restarted strategy when you asked me last time to enable logs. btw - question - can i enable ib logs during strategy running?


Top
 Profile  
 
 Post subject: Re: Wrong order fill
PostPosted: Thu Nov 13, 2014 8:49 pm 
Offline
Site Admin

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

Unfortunately, without the logs, I'm not able to replay the situation and find a reason of this issue.
Yes, you can enable/disable the logging while the strategy is running.
Also, it is always recommended to have the logging enabled for the order execution.

_________________
SmartQuant Development Team


Top
 Profile  
 
 Post subject: Re: Wrong order fill
PostPosted: Thu Nov 13, 2014 10:59 pm 
Offline

Joined: Tue May 01, 2012 6:46 pm
Posts: 97
ok will do this, will enable logs but not sure how quickly this issue will be reproduced.
each such issue requires restart of the strategy and restt portfolio, so it's real headache.

as i understand from one of previous your post it's possible to detect the problem
>>Well, if there is no log, we could try to investigate the problem by another way.
>>Do you run the strategy in Live mode with Persistent flag set?
>>Could you look into the OrderManager window and check for the status of these stop orders,

i have not restarted/reset the portfolio to keep all orders, please let me know what info can help you.
thanks a lot.


Top
 Profile  
 
 Post subject: Re: Wrong order fill
PostPosted: Thu Nov 13, 2014 11:16 pm 
Offline
Site Admin

Joined: Thu Jul 17, 2003 10:39 am
Posts: 1478
I believe that the logs of IB plugin is a right way to find a reason of the problem.
But, you could give us an additional information by showing the reports of 'wrong' order
in the order manager window.

_________________
SmartQuant Development Team


Top
 Profile  
 
 Post subject: Re: Wrong order fill
PostPosted: Fri Nov 14, 2014 4:25 pm 
Offline

Joined: Tue May 01, 2012 6:46 pm
Posts: 97
http://grabilla.com/04b0e-df1ea501-513d ... 62c178.png
here is it.
is it what you asking?


Top
 Profile  
 
 Post subject: Re: Wrong order fill
PostPosted: Fri Nov 14, 2014 5:39 pm 
Offline
Site Admin

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

_________________
SmartQuant Development Team


Top
 Profile  
 
 Post subject: Re: Wrong order fill
PostPosted: Fri Nov 21, 2014 4:46 pm 
Offline

Joined: Tue May 01, 2012 6:46 pm
Posts: 97
Hi Alexei,

Again same problem. Btw it occurs rather often this month - as you see it's third time. Never saw this during last few years.
this time i have logs, please help

this transaction (selected one) :
http://grabilla.com/04b15-c72f2ca7-9a70 ... 5a1e83.png
MGI filled with 500 shares at 9.28 which is wrong (qty and price - both wrong)

IB trade log:
http://grabilla.com/04b15-70717d20-4efc ... 1abf51.png
as you see at this time same qty and same price but for INVE

this order in OrderManager: (the selected one)
http://grabilla.com/04b15-b6a185a2-8581 ... 0c6a95.png


i have attached two log files:
1. OQ IB logs ib-20141120.txt
2. IB TWS logs log.Thu.txt

Thanks,
Ivan


Attachments:
wrong.orders.issue.zip [113.38 KiB]
Downloaded 136 times
Top
 Profile  
 
 Post subject: Re: Wrong order fill
PostPosted: Fri Nov 21, 2014 5:11 pm 
Offline
Site Admin

Joined: Thu Jul 17, 2003 10:39 am
Posts: 1478
Thank you. I will investigate the problem.

_________________
SmartQuant Development Team


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 31 posts ]  Go to page 1, 2, 3  Next

All times are UTC + 3 hours


Who is online

Users browsing this forum: No registered users and 4 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