SmartQuant Discussion

Automated Quantitative Strategy Development, SmartQuant Product Discussion and Technical Support Forums
It is currently Thu Sep 24, 2020 9:11 pm

All times are UTC + 3 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Fri Sep 16, 2011 9:40 pm 
Offline

Joined: Mon Dec 06, 2010 2:15 am
Posts: 47
Could someone assist me by showing a code example:
Program only trades one underlying at a time.
Aim is to pull the quantity currently long or short through "getBrokerInfo" call or some other OpenQuant call.

I would like to be able to call the quantity currently held of the underlying into a double variable such as:

positionSize = BrokerInfo.BrokerPosition(); <---This is the line which is incorrect and I can't tell from the API docs how to finish.
Console.WriteLine("{0},... {1}", PnL, positionSize);

Thanks for the assistance!
Red


Top
 Profile  
 
PostPosted: Sun Sep 18, 2011 8:11 pm 
Offline
Site Admin

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

Code:
positionSize = brokerInfo.Accouns["<account>"].Positions["<symbol>"].Qty;

_________________
SmartQuant Development Team


Top
 Profile  
 
PostPosted: Mon Sep 19, 2011 12:22 am 
Offline

Joined: Mon Dec 06, 2010 2:15 am
Posts: 47
excellent, thank you for the example. :)

Red


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