SmartQuant Discussion

Automated Quantitative Strategy Development, SmartQuant Product Discussion and Technical Support Forums
It is currently Tue Jun 19, 2018 6:56 pm

All times are UTC + 3 hours




Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: Tue Dec 02, 2008 2:58 am 
Offline

Joined: Mon Nov 24, 2008 8:44 pm
Posts: 36
Does these variables represent the net quantity/status of my current position, or an accumulated counter since the positoion is opened?

Say I bought 1000 DELL, then sold 2000 DELL...what would be the QtyBought, QtySold, and QTySoldShort respectively?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Dec 02, 2008 1:58 pm 
Offline

Joined: Wed Oct 08, 2003 1:06 pm
Posts: 833
Hi,

Quote:
Say I bought 1000 DELL, then sold 2000 DELL...what would be the QtyBought, QtySold, and QTySoldShort respectively?


In the current version the values are following:
QtyBought = 1000;
QtySold= 2000;
QtySoldShort = 0;
Qty = 1000;

which is incorrect, so in the next version the values will be:
QtyBought = 1000;
QtySold= 1000;
QtySoldShort = 1000;
Qty = 1000;

Regards,
Sergey.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 03, 2008 1:49 am 
Offline

Joined: Mon Nov 24, 2008 8:44 pm
Posts: 36
Thanks Sergey.

Few more questions related to this...

1) So in the example earlier, say I bought another 1000 to cover my short, would QtyBought be 2000 and Qty be zero? In other words, would QtyBought, Sold, SoldShort keep accumulating quantity of all the transactions in this position, and Qty is the current/net quantity(regardless of short or long)?

2) I was expecting "Amount" to be the position size in dollar...but it appears to be the same as "Qty"...only it shows a negative if we are in short position...correct? Is so, to close a position, I suppose I can do:

if (myPosition.Amount > 0)
sell( Qty, "ABC");
else if( myPosition.Amount < 0)
buy( Qty, "ABC"); // to cover

?

3) I tried to look up the API document for "Side", but it gave me an error...what is it: ('long', 'short'...'buy', 'sell'?). What would it be in my example earlier?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 03, 2008 6:07 pm 
Offline

Joined: Wed Oct 08, 2003 1:06 pm
Posts: 833
Hi,

1)
Quote:
So in the example earlier, say I bought another 1000 to cover my short, would QtyBought be 2000 and Qty be zero? In other words, would QtyBought, Sold, SoldShort keep accumulating quantity of all the transactions in this position, and Qty is the current/net quantity(regardless of short or long)?

Yes and yes.

2) 3) You are right, but you can do the same by checking if (Position.Side == PositionSide.Long) or PositionSide.Short.

Regards,
Sergey.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 03, 2008 6:25 pm 
Offline

Joined: Mon Nov 24, 2008 8:44 pm
Posts: 36
You've been very helpful, thanks!!


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 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