Lean  $LEAN_TAG$
OptimizationNodePacket.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;
22 using QuantConnect.Packets;
23 using QuantConnect.Util;
24 
25 namespace QuantConnect.Optimizer
26 {
27  /// <summary>
28  /// Provide a packet type containing information on the optimization compute job.
29  /// </summary>
31  {
32  /// <summary>
33  /// The optimization name
34  /// </summary>
35  public string Name { get; set; }
36 
37  /// <summary>
38  /// The creation time
39  /// </summary>
40  [JsonConverter(typeof(DateTimeJsonConverter), DateFormat.UI)]
41  public DateTime Created { get; set; }
42 
43  /// <summary>
44  /// User Id placing request
45  /// </summary>
46  public int UserId { get; set; }
47 
48  /// User API Token
49  public string UserToken { get; set; } = string.Empty;
50 
51  /// <summary>
52  /// Project Id of the request
53  /// </summary>
54  public int ProjectId { get; set; }
55 
56  /// <summary>
57  /// Unique compile id of this optimization
58  /// </summary>
59  public string CompileId { get; set; } = string.Empty;
60 
61  /// <summary>
62  /// The unique optimization Id of the request
63  /// </summary>
64  public string OptimizationId { get; set; } = string.Empty;
65 
66  /// <summary>
67  /// Organization Id of the request
68  /// </summary>
69  public string OrganizationId { get; set; } = string.Empty;
70 
71  /// <summary>
72  /// Limit for the amount of concurrent backtests being run
73  /// </summary>
74  public int MaximumConcurrentBacktests { get; set; }
75 
76  /// <summary>
77  /// Optimization strategy name
78  /// </summary>
79  public string OptimizationStrategy { get; set; } = "QuantConnect.Optimizer.Strategies.GridSearchOptimizationStrategy";
80 
81  /// <summary>
82  /// Objective settings
83  /// </summary>
84  public Target Criterion { get; set; }
85 
86  /// <summary>
87  /// Optimization constraints
88  /// </summary>
89  public IReadOnlyList<Constraint> Constraints { get; set; }
90 
91  /// <summary>
92  /// The user optimization parameters
93  /// </summary>
94  public HashSet<OptimizationParameter> OptimizationParameters { get; set; }
95 
96  /// <summary>
97  /// The user optimization parameters
98  /// </summary>
99  [JsonProperty(TypeNameHandling = TypeNameHandling.All)]
101 
102  /// <summary>
103  /// Backtest out of sample maximum end date
104  /// </summary>
105  public DateTime? OutOfSampleMaxEndDate { get; set; }
106 
107  /// <summary>
108  /// The backtest out of sample day count
109  /// </summary>
110  public int OutOfSampleDays { get; set; }
111 
112  /// <summary>
113  /// Creates a new instance
114  /// </summary>
116  {
117  }
118 
119  /// <summary>
120  /// Creates a new instance
121  /// </summary>
122  protected OptimizationNodePacket(PacketType packetType) : base(packetType)
123  {
124  }
125  }
126 
127 }