SmartQuant Discussion

Automated Quantitative Strategy Development, SmartQuant Product Discussion and Technical Support Forums
It is currently Mon Jul 13, 2020 5:14 pm

All times are UTC + 3 hours




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: DataSeries Object
PostPosted: Fri Dec 20, 2019 3:37 pm 
Offline

Joined: Mon Apr 02, 2018 1:39 pm
Posts: 21
I'd like to create a timeseries of objects with (obviously) date/time being the primary index.
Can I do this using the DataSeries Object?

e.g. I have 5 alphas which i follow in real-time / I'd like to be able to create a TimeSeries X which essentially consists of
DateTime pointInTime;
double alpha1 ;
double alpha2 ;
...
double alpha5;

Currently using Dictionary<DateTime , obj> ... thinking OQ DataSeries may be faster?

Thanks


Top
 Profile  
 
 Post subject: Re: DataSeries Object
PostPosted: Mon Dec 23, 2019 11:43 am 
Offline

Joined: Wed May 05, 2010 9:49 pm
Posts: 571
Hi,
for using DataSeries just inherit your custom class from DataObject:
Code:
    public class MyData : DataObject
    {
        public int Property1 { get; set; }
        public bool Property2 { get; set; }

        public MyData(DateTime dateTime, int property1, bool property2) : base(dateTime)
        {
            Property1 = property1;
            Property2 = property2;
        }
    }


usage:
Code:
                DataSeries dataSeries = new DataSeries();

                MyData myData = new MyData(DateTime.Now, 123, true);

                dataSeries.Add(myData);


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