/*
* QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
* Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
using System;
using Newtonsoft.Json;
using System.Collections.Generic;
using QuantConnect.Optimizer.Parameters;
namespace QuantConnect.Api
{
///
/// OptimizationBacktest object from the QuantConnect.com API.
///
[JsonConverter(typeof(OptimizationBacktestJsonConverter))]
public class OptimizationBacktest
{
///
/// Progress of the backtest as a percentage from 0-1 based on the days lapsed from start-finish.
///
public decimal Progress { get; set; }
///
/// The backtest name
///
public string Name { get; }
///
/// The backtest host name
///
public string HostName { get; set; }
///
/// The backtest id
///
public string BacktestId { get; }
///
/// Represent a combination as key value of parameters, i.e. order doesn't matter
///
public ParameterSet ParameterSet { get; }
///
/// The backtest statistics results
///
public IDictionary Statistics { get; set; }
///
/// The backtest equity chart series
///
public CandlestickSeries Equity { get; set; }
///
/// The exit code of this backtest
///
public int ExitCode { get; set; }
///
/// Backtest maximum end date
///
public DateTime? OutOfSampleMaxEndDate { get; set; }
///
/// The backtest out of sample day count
///
public int OutOfSampleDays { get; set; }
///
/// The backtest start date
///
public DateTime StartDate { get; set; }
///
/// The backtest end date
///
public DateTime EndDate { get; set; }
///
/// Creates a new instance
///
/// The parameter set
/// The backtest id if any
/// The backtest name
public OptimizationBacktest(ParameterSet parameterSet, string backtestId, string name)
{
ParameterSet = parameterSet;
BacktestId = backtestId;
Name = name;
}
}
}