Lean  $LEAN_TAG$
LiveAlgorithmResults.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 Newtonsoft.Json;
17 using Newtonsoft.Json.Converters;
18 using QuantConnect.Packets;
19 using System;
20 using System.Collections.Generic;
21 
22 namespace QuantConnect.Api
23 {
24  /// <summary>
25  /// Details a live algorithm from the "live/read" Api endpoint
26  /// </summary>
28  {
29  /// <summary>
30  /// Error message
31  /// </summary>
32  public string Message { get; set; }
33 
34  /// <summary>
35  /// Indicates the status of the algorihtm, i.e. 'Running', 'Stopped'
36  /// </summary>
37  public string Status { get; set; }
38 
39  /// <summary>
40  /// Algorithm deployment ID
41  /// </summary>
42  public string DeployId { get; set; }
43 
44  /// <summary>
45  /// The snapshot project ID for cloning the live development's source code.
46  /// </summary>
47  public int CloneId { get; set; }
48 
49  /// <summary>
50  /// Date the live algorithm was launched
51  /// </summary>
52  public DateTime Launched { get; set; }
53 
54  /// <summary>
55  /// Date the live algorithm was stopped
56  /// </summary>
57  public DateTime? Stopped { get; set; }
58 
59  /// <summary>
60  /// Brokerage used in the live algorithm
61  /// </summary>
62  public string Brokerage { get; set; }
63 
64  /// <summary>
65  /// Security types present in the live algorithm
66  /// </summary>
67  public string SecurityTypes { get; set; }
68 
69  /// <summary>
70  /// Name of the project the live algorithm is in
71  /// </summary>
72  public string ProjectName { get; set; }
73 
74  /// <summary>
75  /// Name of the data center where the algorithm is physically located.
76  /// </summary>
77  public string Datacenter { get; set; }
78 
79  /// <summary>
80  /// Indicates if the algorithm is being live shared
81  /// </summary>
82  public bool Public { get; set; }
83 
84  /// <summary>
85  /// Files present in the project in which the algorithm is
86  /// </summary>
87  public List<ProjectFile> Files { get; set; }
88 
89  /// <summary>
90  /// Runtime banner/updating statistics in the title banner of the live algorithm GUI.
91  /// </summary>
92  [JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
93  public IDictionary<string, string> RuntimeStatistics { get; set; }
94 
95  /// <summary>
96  /// Charts updates for the live algorithm since the last result packet
97  /// </summary>
98  [JsonProperty(NullValueHandling = NullValueHandling.Ignore)]
99  public IDictionary<string, Chart> Charts { get; set; }
100  }
101 
102  /// <summary>
103  /// Holds information about the state and operation of the live running algorithm
104  /// </summary>
105  public class LiveResultsData
106  {
107  /// <summary>
108  /// Results version
109  /// </summary>
110  public int Version { get; set; }
111 
112  /// <summary>
113  /// Temporal resolution of the results returned from the Api
114  /// </summary>
115  [JsonProperty(PropertyName = "resolution"), JsonConverter(typeof(StringEnumConverter))]
116  public Resolution Resolution { get; set; }
117 
118  /// <summary>
119  /// Class to represent the data groups results return from the Api
120  /// </summary>
121  [JsonProperty(PropertyName = "results")]
122  public LiveResult Results { get; set; }
123  }
124 }