/*
* 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 Newtonsoft.Json;
using System.Collections.Generic;
using System.ComponentModel;
namespace QuantConnect.Optimizer
{
///
/// Aggregate diagnostic produced by analyzing a completed optimization.
///
public class OptimizationAnalysis
{
///
/// Natural-language interpretation of the analysis produced by a downstream AI consumer; empty until populated.
///
[DefaultValue("")]
[JsonProperty(DefaultValueHandling = DefaultValueHandling.Ignore)]
public string Interpretation { get; set; } = string.Empty;
///
/// Total number of backtests observed, including failures.
///
public int BacktestCountTotal { get; set; }
///
/// Number of backtests used in the analysis after filtering failures.
///
public int BacktestCountUsed { get; set; }
///
/// Sharpe ratio statistics across all used backtests.
///
public SharpeSummary OverallSharpe { get; set; }
///
/// The best-performing backtest (argmax of Sharpe).
///
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public BacktestSummary Best { get; set; }
///
/// Per-parameter sensitivity report; one entry per optimized parameter.
///
public IReadOnlyList Parameters { get; set; }
///
/// K-means clusters in standardized parameter space, ordered by mean Sharpe descending.
///
public IReadOnlyList Clusters { get; set; }
///
/// Local maxima of the Sharpe surface on the parameter grid, ordered by Sharpe descending.
///
public IReadOnlyList Modes { get; set; }
///
/// Breakdown of zero-order backtests; null when none exist.
///
[JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
public FailedBacktestSummary FailedBacktests { get; set; }
}
}