SmartQuant Discussion
http://www.smartquant.com/forums/

DataSeries Object
http://www.smartquant.com/forums/viewtopic.php?f=43&t=14991
Page 1 of 1

Author:  zbxxxx [ Fri Dec 20, 2019 3:37 pm ]
Post subject:  DataSeries Object

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

Author:  skuvv [ Mon Dec 23, 2019 11:43 am ]
Post subject:  Re: DataSeries Object

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);

Page 1 of 1 All times are UTC + 3 hours
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/