Ejemplo n.º 1
0
 public BacktestResultPacket(string json)
     : base(PacketType.BacktestResult)
 {
     try
     {
         var packet = JsonConvert.DeserializeObject <BacktestResultPacket>(json, new JsonSerializerSettings
         {
             TypeNameHandling = TypeNameHandling.Auto
         });
         CompileId      = packet.CompileId;
         Channel        = packet.Channel;
         PeriodFinish   = packet.PeriodFinish;
         PeriodStart    = packet.PeriodStart;
         Progress       = packet.Progress;
         SessionId      = packet.SessionId;
         BacktestId     = packet.BacktestId;
         Type           = packet.Type;
         UserId         = packet.UserId;
         DateFinished   = packet.DateFinished;
         DateRequested  = packet.DateRequested;
         Name           = packet.Name;
         ProjectId      = packet.ProjectId;
         Results        = packet.Results;
         ProcessingTime = packet.ProcessingTime;
         TradeableDates = packet.TradeableDates;
     }
     catch (Exception err)
     {
         Log.Trace("BacktestResultPacket(): Error converting json: " + err);
     }
 }
Ejemplo n.º 2
0
 public BacktestResultPacket(BacktestNodePacket job, BacktestResult results, decimal progress = 1m)
     : base(PacketType.BacktestResult)
 {
     try
     {
         Progress       = Math.Round(progress, 3);
         SessionId      = job.SessionId;
         PeriodFinish   = job.PeriodFinish;
         PeriodStart    = job.PeriodStart;
         CompileId      = job.CompileId;
         Channel        = job.Channel;
         BacktestId     = job.BacktestId;
         Results        = results;
         Name           = job.Name;
         UserId         = job.UserId;
         ProjectId      = job.ProjectId;
         SessionId      = job.SessionId;
         TradeableDates = job.TradeableDates;
     }
     catch (Exception err) {
         Log.Error(err);
     }
 }