// we're reading these values from file, // bc it's faster than recalculating each time public static TradeResult Init(string resultline) { string[] res = resultline.Split(','); TradeResult r = new TradeResult(); r.Source = TradeImpl.FromString(resultline); r.OpenPL = Convert.ToDecimal(res[s]); r.ClosedPL = Convert.ToDecimal(res[s + 1]); r.OpenSize = Convert.ToInt32(res[s + 2]); r.ClosedSize = Convert.ToInt32(res[s + 3]); r.AvgPrice = Convert.ToDecimal(res[s + 4]); return r; }