Lean  $LEAN_TAG$
LiveAlgorithm.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 using System;
16 using System.Collections.Generic;
17 using Newtonsoft.Json;
18 
19 namespace QuantConnect.Api
20 {
22  {
23  /// <summary>
24  /// Project id for the live instance
25  /// </summary>
26  public int ProjectId { get; set; }
27 
28  /// <summary>
29  /// Unique live algorithm deployment identifier (similar to a backtest id).
30  /// </summary>
31  public string DeployId { get; set; }
32  }
33 
35  {
36  /// <summary>
37  /// The version of the Lean used to run the algorithm
38  /// </summary>
39  public int VersionId { get; set; }
40 
41  /// <summary>
42  /// Id of the node that will run the algorithm
43  /// </summary>
44  public string Source { get; set; }
45 
46  /// <summary>
47  /// HTTP status response code
48  /// </summary>
49  public string ResponseCode { get; set; }
50  }
51 
52  /// <summary>
53  /// Response from List Live Algorithms request to QuantConnect Rest API.
54  /// </summary>
56  {
57  /// <summary>
58  /// Algorithm status: running, stopped or runtime error.
59  /// </summary>
60  public AlgorithmStatus Status { get; set; }
61 
62  /// <summary>
63  /// Datetime the algorithm was launched in UTC.
64  /// </summary>
65  public DateTime Launched { get; set; }
66 
67  /// <summary>
68  /// Datetime the algorithm was stopped in UTC, null if its still running.
69  /// </summary>
70  public DateTime? Stopped { get; set; }
71 
72  /// <summary>
73  /// Brokerage
74  /// </summary>
75  public string Brokerage { get; set; }
76 
77  /// <summary>
78  /// Chart we're subscribed to
79  /// </summary>
80  /// <remarks>
81  /// Data limitations mean we can only stream one chart at a time to the consumer. See which chart you're watching here.
82  /// </remarks>
83  public string Subscription { get; set; }
84 
85  /// <summary>
86  /// Live algorithm error message from a crash or algorithm runtime error.
87  /// </summary>
88  public string Error { get; set; }
89  }
90 
91  /// <summary>
92  /// List of the live algorithms running which match the requested status
93  /// </summary>
94  public class LiveList : RestResponse
95  {
96  /// <summary>
97  /// Algorithm list matching the requested status.
98  /// </summary>
99  [JsonProperty(PropertyName = "live")]
100  public List<LiveAlgorithmSummary> Algorithms { get; set; }
101  }
102 }