SmartQuant Discussion

Automated Quantitative Strategy Development, SmartQuant Product Discussion and Technical Support Forums
It is currently Mon Nov 30, 2020 5:47 pm

All times are UTC + 3 hours




Post new topic Reply to topic  [ 7 posts ] 
Author Message
PostPosted: Mon Aug 10, 2009 12:41 pm 
Offline

Joined: Sat Jun 06, 2009 11:23 pm
Posts: 35
Hi folks,

I have a strategy that uses replace method to replace the orders. BUT the TT API doesn't support replace() so I have a problem. what is the most efficient work around that I can create in my strategy? It has to involve cancel() and send().

Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 10, 2009 4:05 pm 
Offline

Joined: Sat Jun 07, 2008 1:41 pm
Posts: 47
Location: Munich, Germany
Instead of

MyOrder.Replace();



you should use


MyOrder.Cancel();
//Calculate limit-prices
MyOrder = LimitOrder(...);
MyOrder.Send();


When you fear some realtime-problems you poll if your order is deleted and then fire the next order.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Aug 10, 2009 6:06 pm 
Offline

Joined: Tue Aug 05, 2003 3:43 pm
Posts: 6817
PS. We will try to add native Replace() for TT API in the next release.

Regards,
Anton


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 11, 2009 12:53 am 
Offline

Joined: Sat Jun 06, 2009 11:23 pm
Posts: 35
Thanks guys.

RDT I tried your solution but I get the run time exception like "Key Already Added" at the point MyOrder.Send().

Is it due to the fact that the order which has already been sent is being tried to send again? How can I fix this issue?

Thanks


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 11, 2009 9:47 am 
Offline

Joined: Sat Jun 07, 2008 1:41 pm
Posts: 47
Location: Munich, Germany
Possibilities are:

1.

You use different orders. E.g.

MyOrder1 and MyOrder2. When you delete MyOrder1 you send MyOrder2.


2.

Or you use the event-handler OnOrderCancelled. This should be activated whenever an order is deleted (I never tried but it should work).


3.

You should try something like if (!MyOrder) or the flags like MyOrder.IsCancelled, etc. Here you should find out what works and what not.


Order-handling is something you should master. Otherwise it doesn't make any sense to think about live-trading.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Aug 11, 2009 11:35 am 
Offline

Joined: Tue Aug 05, 2003 3:43 pm
Posts: 6817
NtireTech wrote:
Thanks guys.

RDT I tried your solution but I get the run time exception like "Key Already Added" at the point MyOrder.Send().

Is it due to the fact that the order which has already been sent is being tried to send again? How can I fix this issue?

Thanks


Hi,

can you be more specific on this issue? Can you send us your strategy code (or code snippet) that generates this exception?

Thanks,
Anton


Top
 Profile  
 
PostPosted: Thu Nov 03, 2011 12:12 pm 
Offline

Joined: Sun Oct 30, 2011 12:12 am
Posts: 220
My post about the same type of issue might help:
viewtopic.php?f=60&t=6251&p=30680#p30680


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

All times are UTC + 3 hours


Who is online

Users browsing this forum: No registered users and 1 guest


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