SmartQuant Discussion

Automated Quantitative Strategy Development, SmartQuant Product Discussion and Technical Support Forums
It is currently Wed Dec 13, 2017 2:51 am

All times are UTC + 3 hours




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: loading historical bars
PostPosted: Thu Jan 28, 2016 11:42 pm 
Offline

Joined: Tue Dec 23, 2008 9:38 pm
Posts: 2
i am looking for the most efficient code for loading historical bars at startup without using too much computer resources.

currently i use the GetHistoricalBars() call to load bars at strategy startup; but the process is very slow with multiple symbols. some of this is because it is 'overwriting' bars already in the dataManager.

1. is there a way to only call the missing data, or call the data from the datamanager for older data and just update the data with more recent missing data?

2. should the save data code --- DataManager.Add(Instrument, bar) NOT be included in the strategy? or somehow put on a separate thread than the main strategy?

3. should the BarSeries created to catch the GetHistoricalBars() be deleted or cleared once the historical bars have been added at OnBar(bar)?

i see parts of this type of code in the forums, but not enough code for me to copy/emulate. Thank you.


Top
 Profile  
 
PostPosted: Fri May 06, 2016 10:48 am 
Offline

Joined: Wed May 05, 2010 9:49 pm
Posts: 392
Hello James,
GetHistoricalBars() performance in general depends from provider, but usually it quite fast.
Eg IQFeed downloads a data with about 100k events/sec.

Next if you add downloaded data as new data(add to end of series) in DataManager, it will be fast.
If you want insert data, it will be slow.
Probably it will be faster if you will drop full series to disk, clear a series in DataManager and save all data(from disk and downloaded) tick by tick in right order.

1) There is no way to call a missing data, because nobody knows which data is missing etc.
2) You can create your own thread, but I not test this approach, it can be a harmful.
3) It is question for C#, if you don't keep link to series from GetHistoricalBars() then it will be cleared after end of method.


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 3 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