public virtual void Estimate(HashSet <OptimizationParameter> optimizationParameters, int expected) { Strategy.Initialize( new Target("Profit", new Maximization(), null), null, optimizationParameters, CreateSettings()); Assert.AreEqual(expected, Strategy.GetTotalBacktestEstimate()); }
/// <summary> /// Returns the current optimization status and strategy estimates /// </summary> public OptimizationEstimate GetCurrentEstimate() { var completedCount = _completedBacktest; var runtime = DateTime.UtcNow - _startedAt; return(new OptimizationEstimate { TotalBacktest = Strategy.GetTotalBacktestEstimate(), CompletedBacktest = completedCount, FailedBacktest = _failedBacktest, RunningBacktest = RunningParameterSetForBacktest.Count, InQueueBacktest = PendingParameterSet.Count, AverageBacktest = completedCount > 0 ? new TimeSpan(runtime.Ticks / completedCount) : TimeSpan.Zero, TotalRuntime = runtime }); }
/// <summary> /// Returns the current optimization status and strategy estimates /// </summary> public int GetCurrentEstimate() { return(Strategy.GetTotalBacktestEstimate()); }