SmartQuant Discussion

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

All times are UTC + 3 hours




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Thu Mar 24, 2011 6:08 pm 
Offline

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

I have a strategy that only runs during certain hours (say 12:00 UTC to 17:00 UTC). However, I need the highest and lowest prices for the entire market trading day.

How can I programmatically import all prices (say in 1 minute intervals such that 1bar - 1 minute) into a BarSeries from which I can get the .LowestLow and .HighestHigh properties?

Additionally, is it possible to then chain the day's historicals onto another BarSeries that contains prices during my trading hours? Specifically, can I create a BarSeries that combines the historical prices to the live/current prices?

Thank you.


Top
 Profile  
 
PostPosted: Thu Mar 24, 2011 6:12 pm 
Offline

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

perhaps this may help

viewtopic.php?f=64&t=6227

Regards,
Anton


Top
 Profile  
 
PostPosted: Thu Mar 24, 2011 7:20 pm 
Offline

Joined: Tue Mar 15, 2011 7:15 pm
Posts: 80
That was helpful. I had seen this posting previously.

Perhaps I should explain my question a bit better....I want to import historicals from some starting time to an ending time.

I use:
BarSeries histBarSeries = DataManager.GetHistoricalBars(myInstr,startOfTrdDay,
DateTime.UtcNow.AddSeconds(-1), BarType.Tick,1);

to import the historicals....I set the end time to 1 seconds before Now.

I then create a 1-tick bar:
barSeries_1Tick = GetBars(BarType.Tick,1); //this is our live pricing barSeries

And then try to add the historical bars to the newly created barSeries_1Tick:
for (int i = 0; i<histBarSeries.Count;i++) barSeries_1Tick.Add(histBarSeries[i]);

I then want barSeries_1Tick to remain live and continue adding tick bars as new quotes come in. I am not certain if the code I have used will work properly. Is seems to be working, but I want to make sure it doesn't have subsequent problems. Can you opine whether this code should be fine going forward?

Thank you.


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