SmartQuant Discussion

Automated Quantitative Strategy Development, SmartQuant Product Discussion and Technical Support Forums
It is currently Sun Nov 28, 2021 8:20 am

All times are UTC + 3 hours

Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Thu May 26, 2016 12:00 pm 

Joined: Thu Jun 04, 2015 2:10 pm
Posts: 25

I am trying to place few orders but immediately after leaving OnBar event it execute OnOrderCancel event and therefore initially if I stacked 6 offers on OnBar event than 5 out 6 gets cancel immediately on the same Bar.
(so left with only 1 working offer on next bar)

In my strategy when a condition change I remove all the stacked orders and than re-stack the orders on new prices.
To achieve this I am first calling CancelAll(OrderSide.Sell); // To cancel all offers (which is not canceling the left 1 offer)
Now after stacking the 6 offers again I have 7 offers working which again gets canceled on the same bar (6 canceled) and left again with only 1 working offer on the next bar.

So in conclusion its always the last placed offer in the queue which does not get canceled and rest all gets canceled on the same bar.

I have seen the other thread and tried to put ExecutionSimulator.Queued = false; but did not worked.

My Scenerio file looks like this:
strategy = new MyStrategy(framework, "newStrategy");
Instrument instrument2 = InstrumentManager.Instruments["MSFT"];

DataSimulator.DateTime1 = new DateTime(2015, 03, 30);
DataSimulator.DateTime2 = new DateTime(2015, 04, 10);

DataSimulator.SubscribeBid = false;
DataSimulator.SubscribeAsk = false;
DataSimulator.SubscribeTrade = false;
DataSimulator.SubscribeBar = true;

ExecutionSimulator.FillOnBar = true;
ExecutionSimulator.Queued = false;

BarFactory.Add(instrument1, BarType.Time, 600);
BarFactory.Add(instrument1, BarType.Time, 60);
DataSimulator.BarFilter.Add(BarType.Time, 600);


Attached the screen shot of OrderManager showing Orders getting cancel on the same bar.

OpenQuant Version 1.0.5928.33808

Please assist.


Capture.PNG [ 34.46 KiB | Viewed 3425 times ]
PostPosted: Fri May 27, 2016 12:16 pm 

Joined: Wed May 05, 2010 9:49 pm
Posts: 583
Hello prashant,
can you please provide a code sample for managing orders which represent your situation?

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 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:  
Powered by phpBB® Forum Software © phpBB Group