SmartQuant Discussion

Automated Quantitative Strategy Development, SmartQuant Product Discussion and Technical Support Forums
It is currently Sat Oct 24, 2020 8:51 am

All times are UTC + 3 hours




Post new topic Reply to topic  [ 1 post ] 
Author Message
PostPosted: Wed Dec 28, 2011 7:02 pm 
Offline

Joined: Tue Mar 15, 2011 7:15 pm
Posts: 80
Hello,

I need to loop through a set of instruments in InstrumentManager and create BarSeries for these instruments. I want to retain the BarSeries after pulling in historical bars and append new (5M) bars throughout the trading session. Therefore, I need the BarSeries objects to retain their scope outside the foreach loop. The number of instruments I need to pull from InstrumentManager will changes periodically, so I need a set of BarSeries that can grow dynamically. I am not exactly sure how to do this within OQ.

As an example, say I have:
foreach (Instrument instrument in InstrumentManager)
{
BarSeries bs = GetHistoricalBars(...);
}


Can I create a List of BarSeries? Say something like:

List<BarSeries> bsList = new List<BarSeries>();
foreach (Instrument instrument in InstrumentManager)
{
BarSeries bs = GetHistoricalBars(...);
bsList.Add(bs);
}


Any help on the proper syntax would be very useful. Thank you.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

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