Lean  $LEAN_TAG$
Optimization.cs
1 /*
2  * QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
3  * Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14 */
15 
16 using System;
17 using System.Collections.Generic;
18 using Newtonsoft.Json;
21 
22 namespace QuantConnect.Api
23 {
24  /// <summary>
25  /// Optimization response packet from the QuantConnect.com API.
26  /// </summary>
28  {
29  /// <summary>
30  /// Runtime banner/updating statistics for the optimization
31  /// </summary>
32  [JsonProperty(PropertyName = "runtimeStatistics", NullValueHandling = NullValueHandling.Ignore)]
33  public IDictionary<string, string> RuntimeStatistics { get; set; }
34 
35  /// <summary>
36  /// Optimization constraints
37  /// </summary>
38  [JsonProperty(PropertyName = "constraints", NullValueHandling = NullValueHandling.Ignore)]
39  public IReadOnlyList<Constraint> Constraints { get; set; }
40 
41  /// <summary>
42  /// Optimization parameters
43  /// </summary>
44  [JsonProperty(PropertyName = "parameters", NullValueHandling = NullValueHandling.Ignore)]
45  public HashSet<OptimizationParameter> Parameters { get; set; }
46 
47  /// <summary>
48  /// Number of parallel nodes for optimization
49  /// </summary>
50  [JsonProperty(PropertyName = "parallelNodes")]
51  public int ParallelNodes { get; set; }
52 
53  /// <summary>
54  /// Optimization constraints
55  /// </summary>
56  [JsonProperty(PropertyName = "backtests", NullValueHandling = NullValueHandling.Ignore)]
57  public IDictionary<string, OptimizationBacktest> Backtests { get; set; }
58 
59  /// <summary>
60  /// Optimization strategy
61  /// </summary>
62  [JsonProperty(PropertyName = "strategy")]
63  public string Strategy { get; set; }
64 
65  /// <summary>
66  /// Optimization requested date and time
67  /// </summary>
68  [JsonProperty(PropertyName = "requested")]
69  public DateTime Requested { get; set; }
70  }
71 
72  /// <summary>
73  /// Wrapper class for Optimizations/Read endpoint JSON response
74  /// </summary>
76  {
77  /// <summary>
78  /// Optimization object
79  /// </summary>
80  [JsonProperty(PropertyName = "optimization")]
81  public Optimization Optimization { get; set; }
82  }
83 
84  /// <summary>
85  /// Collection container for a list of summarized optimizations for a project
86  /// </summary>
88  {
89  /// <summary>
90  /// Collection of summarized optimization objects
91  /// </summary>
92  [JsonProperty(PropertyName = "optimizations")]
93  public List<BaseOptimization> Optimizations { get; set; }
94  }
95 }