SmartQuant Discussion

Automated Quantitative Strategy Development, SmartQuant Product Discussion and Technical Support Forums
It is currently Mon Sep 16, 2019 7:37 am

All times are UTC + 3 hours




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Wed Jan 30, 2013 2:12 am 
Offline

Joined: Mon Nov 12, 2012 2:38 am
Posts: 59
In some situation, People need to do some information collection in StrategyStart and do some comparision/selection after all OnStrategyStart are done and before any Onbar/OnTrade/OnQuote, So I suggest to add a overidable method there.


Top
 Profile  
 
PostPosted: Wed Jan 30, 2013 11:17 am 
Offline

Joined: Tue Aug 05, 2003 3:43 pm
Posts: 6816
Hi,

you can add a static count to your class and then in OnStrategyStart

static int count = 0;

public override void OnStrategyStart()
{
// do something

count++;

if (Instruments.Count == count)
// all other OnStrategyStart are done
}

Regards,
Anton


Top
 Profile  
 
PostPosted: Wed Jan 30, 2013 1:51 pm 
Offline

Joined: Mon Nov 12, 2012 2:38 am
Posts: 59
Thanks for your reply. Surely above solution can deal with Single-Strategy/Multi-Instrument.
But for Multi-Strategy/Multi-Instrument, this solution is not enough. That is the reason I posted the request :-)


Top
 Profile  
 
PostPosted: Tue Mar 26, 2013 1:51 am 
Offline

Joined: Thu Jun 08, 2006 3:56 pm
Posts: 537
Location: BC Canada
For a multi-strategy solution, you will have to store the count in the global hash table; it can be seen by all strategies and instruments. Search the forums for global hashtable examples.


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