SmartQuant Discussion

Automated Quantitative Strategy Development, SmartQuant Product Discussion and Technical Support Forums
It is currently Wed Aug 05, 2020 5:02 pm

All times are UTC + 3 hours

Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Mon Sep 24, 2012 3:39 pm 

Joined: Mon Feb 21, 2011 10:46 am
Posts: 48
I've just found that when an order is partially filled and OnOrderPartiallyFilled event is fired, Position.Qty does not change at all, UNTIL OnOrderFilled event is fired. This could lead to disasters sometimes.

My solution to this problem is to manually create a variable (e.g. myPosition) and change it when OnOrderPartiallyFilled/OnOrderFilled event is fired. But I do hope Strategy.Position.Qty field could sync with actual position.

PostPosted: Tue Sep 25, 2012 11:10 am 

Joined: Tue Aug 05, 2003 3:43 pm
Posts: 6817

yes, this is true and this issue has been discussed several times on this forum. The thing is that initially we had an idea to split order propagation chain into two layers. One, low layer, deals with execution reports and orders, and consequantly operates with partial fills and order quantities. The other, transaction and portfolio position layer, deals with transactions, which represent complete order fills. We though that such structure would simplify startegy development. Actually it does simplify strategy development (so that most of time you simply write HasPosition in your strategy entry and exit code and don't bother with partial positions/fills tracking) but on the other hand it turns out that this might lead to some sort of confusion that you've described in your post.

We will try to imporve this concept in a new version of the framework.


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 3 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:  
Powered by phpBB® Forum Software © phpBB Group