Esempio n. 1
0
 /******************************************************** 
 * CLASS METHODS
 *********************************************************/
 /// <summary>
 /// Convert the charting data into an equity array:
 /// </summary>
 /// <param name="points"></param>
 /// <returns></returns>
 private static SortedDictionary<DateTime, decimal> ChartPointToDictionary(IEnumerable<ChartPoint> points)
 {
     var dictionary = new SortedDictionary<DateTime, decimal>();
     try
     {
         foreach (ChartPoint point in points)
         {
             DateTime x = Time.UnixTimeStampToDateTime(point.x);
             if (!dictionary.ContainsKey(x))
             {
                 dictionary.Add(x, point.y);
             }
             else
             {
                 dictionary[x] = point.y;
             }
         }
     }
     catch (Exception err)
     {
         Log.Error("Statistics.ChartPointToDictionary(): " + err.Message);
     }
     return dictionary;
 }
Esempio n. 2
0
 /// <summary>
 /// Provides a readable string representation of this instance.
 /// </summary>
 public override string ToString()
 {
     return(Time.UnixTimeStampToDateTime(x).ToString("o") + " - " + y);
 }
Esempio n. 3
0
 /// <summary>
 /// Provides a readable string representation of this instance.
 /// </summary>
 public override string ToString()
 {
     return(Invariant($"{Time.UnixTimeStampToDateTime(x):o} - {y}"));
 }