public override object Read(BinaryReader reader)
 {
     TimeSeriesItem timeSeriesItem = new TimeSeriesItem();
     reader.ReadByte();
     timeSeriesItem.dateTime = DateTime.FromBinary(reader.ReadInt64());
     timeSeriesItem.value = reader.ReadDouble();
     return timeSeriesItem;
 }
Beispiel #2
0
 public TimeSeries()
 {
     this.items = new List<TimeSeriesItem>();
     this.min = null;
     this.max = null;
     this.changed = true;
     this.indicators = new List<Indicator>();
 }
Beispiel #3
0
        public override void Write(BinaryWriter writer, object obj)
        {
            TimeSeriesItem timeSeriesItem = (TimeSeriesItem)obj;

            writer.Write(0);
            writer.Write(timeSeriesItem.dateTime.ToBinary());
            writer.Write(timeSeriesItem.value);
        }
Beispiel #4
0
        public override object Read(BinaryReader reader)
        {
            TimeSeriesItem timeSeriesItem = new TimeSeriesItem();

            reader.ReadByte();
            timeSeriesItem.dateTime = DateTime.FromBinary(reader.ReadInt64());
            timeSeriesItem.value    = reader.ReadDouble();
            return(timeSeriesItem);
        }
Beispiel #5
0
 public TimeSeries(string name, string description = "")
 {
     this.name = name;
     this.description = description;
     this.items = new List<TimeSeriesItem>();
     this.min = null;
     this.max = null;
     this.changed = true;
     this.indicators = new List<Indicator>();
 }
Beispiel #6
0
 public TimeSeriesItem(TimeSeriesItem item)
 {
     this.dateTime = item.dateTime;
     this.value = item.value;
 }
Beispiel #7
0
 public void Clear()
 {
     this.items.Clear();
     this.min = null;
     this.max = null;
     this.changed = true;
 }
Beispiel #8
0
 public void Add(DateTime dateTime, double value)
 {
     TimeSeriesItem timeSeriesItem = new TimeSeriesItem(dateTime, value);
     if (this.min == null)
     {
         this.min = timeSeriesItem;
     }
     else
     {
         if (timeSeriesItem.value < this.min.value)
         {
             this.min = timeSeriesItem;
         }
     }
     if (this.max == null)
     {
         this.max = timeSeriesItem;
     }
     else
     {
         if (timeSeriesItem.value > this.max.value)
         {
             this.max = timeSeriesItem;
         }
     }
     this.items.Add(timeSeriesItem);
     int index = this.items.Count - 1;
     for (int i = 0; i < this.indicators.Count; i++)
     {
         this.indicators[i].Calculate(index);
     }
 }
 public TimeSeriesItem(TimeSeriesItem item) : this(item.DateTime, item.Value)
 {
 }
Beispiel #10
0
 public TimeSeriesItem(TimeSeriesItem item)
 {
     this.dateTime = item.dateTime;
     this.value    = item.value;
 }
Beispiel #11
0
 public TimeSeriesItem(TimeSeriesItem item) : this(item.DateTime, item.Value)
 {
 }