SmartQuant Discussion

Automated Quantitative Strategy Development, SmartQuant Product Discussion and Technical Support Forums
It is currently Thu Nov 23, 2017 4:15 pm

All times are UTC + 3 hours




Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Tue Feb 28, 2017 12:56 am 
Offline

Joined: Thu Sep 17, 2015 5:52 am
Posts: 133
Hi SQ,

What is the simplest way to get a position's entry price when strategy = Strategy (rather then when strategy = InstrumentStrategy)?

I tried Position.EntryPrice but it only seems to work if strategy = InstrumentStrategy

thanks


Top
 Profile  
 
PostPosted: Tue Feb 28, 2017 11:37 am 
Offline

Joined: Wed May 05, 2010 9:49 pm
Posts: 386
Hello,
you can use following code in Strategy:
Code:
if (HasPosition(instrument))
{
Position position = Portfolio.GetPosition(instrument);
}


Top
 Profile  
 
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 4 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:  
cron
Powered by phpBB® Forum Software © phpBB Group