/******************************************************** * 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; }
/// <summary> /// Provides a readable string representation of this instance. /// </summary> public override string ToString() { return(Time.UnixTimeStampToDateTime(x).ToString("o") + " - " + y); }
/// <summary> /// Provides a readable string representation of this instance. /// </summary> public override string ToString() { return(Invariant($"{Time.UnixTimeStampToDateTime(x):o} - {y}")); }