Ejemplo n.º 1
0
 // 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 = TradeLink.Common.TradeImpl.FromString(resultline);
     if (res[s] != string.Empty || res[s] != "")
         r.OpenPL = Convert.ToDecimal(res[s], System.Globalization.CultureInfo.InvariantCulture);
     if (res[s + 1] != string.Empty || res[s + 1] != "")
         r.ClosedPL = Convert.ToDecimal(res[s + 1], System.Globalization.CultureInfo.InvariantCulture);
     if (res[s + 2] != string.Empty || res[s + 2] != "")
         r.OpenSize = Convert.ToInt32(res[s + 2], System.Globalization.CultureInfo.InvariantCulture);
     if (res[s + 3] != string.Empty || res[s + 3] != "")
         r.ClosedSize = Convert.ToInt32(res[s + 3], System.Globalization.CultureInfo.InvariantCulture);
     if (res[s + 4] != string.Empty || res[s + 4] != "")
         r.AvgPrice = Convert.ToDecimal(res[s + 4], System.Globalization.CultureInfo.InvariantCulture);
     return r;
 }
Ejemplo n.º 2
0
 public Results FetchResults(decimal rfr, decimal commiss)
 {
     return(FetchResults(TradeResult.ResultsFromTradeList(fills), rfr, commiss, debug));
 }