Lean  $LEAN_TAG$
LiveResultParameters.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 
17 using System;
18 using QuantConnect.Orders;
20 using System.Collections.Generic;
21 
22 namespace QuantConnect.Packets
23 {
24  /// <summary>
25  /// Defines the parameters for <see cref="LiveResult"/>
26  /// </summary>
28  {
29  /// <summary>
30  /// Holdings dictionary of algorithm holdings information
31  /// </summary>
32  public IDictionary<string, Holding> Holdings { get; set; }
33 
34  /// <summary>
35  /// Cashbook for the algorithm's live results.
36  /// </summary>
37  public CashBook CashBook { get; set; }
38 
39  /// <summary>
40  /// Server status information, including CPU/RAM usage, ect...
41  /// </summary>
42  public IDictionary<string, string> ServerStatistics { get; set; }
43 
44  /// <summary>
45  /// Creates a new instance
46  /// </summary>
47  public LiveResultParameters(IDictionary<string, Chart> charts,
48  IDictionary<int, Order> orders,
49  IDictionary<DateTime, decimal> profitLoss,
50  IDictionary<string, Holding> holdings,
51  CashBook cashBook,
52  IDictionary<string, string> statistics,
53  IDictionary<string, string> runtimeStatistics,
54  List<OrderEvent> orderEvents,
55  IDictionary<string, string> serverStatistics = null,
56  AlgorithmConfiguration algorithmConfiguration = null,
57  IDictionary<string, string> state = null)
58  : base(charts, orders, profitLoss, statistics, runtimeStatistics, orderEvents, algorithmConfiguration, state)
59  {
60  Holdings = holdings;
61  CashBook = cashBook;
62  ServerStatistics = serverStatistics ?? OS.GetServerStatistics();
63  }
64  }
65 }