Lean
$LEAN_TAG$
ReservedBuyingPowerImpact.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.Collections.Generic;
17
18
namespace
QuantConnect.Securities.Positions
19
{
20
/// <summary>
21
/// Specifies the impact on buying power from changing security holdings that affects current <see cref="IPositionGroup"/>,
22
/// including the current reserved buying power, without the change, and a contemplate reserved buying power, which takes
23
/// into account a contemplated change to the algorithm's positions that impacts current position groups.
24
/// </summary>
25
public
class
ReservedBuyingPowerImpact
26
{
27
/// <summary>
28
/// Gets the current reserved buying power for the impacted groups
29
/// </summary>
30
public
decimal
Current
{
get
; }
31
32
/// <summary>
33
/// Gets the reserved buying power for groups resolved after applying a contemplated change to the impacted groups
34
/// </summary>
35
public
decimal
Contemplated
{
get
; }
36
37
/// <summary>
38
/// Gets the change in reserved buying power, <see cref="Current"/> minus <see cref="Contemplated"/>
39
/// </summary>
40
public
decimal
Delta
{
get
; }
41
42
/// <summary>
43
/// Gets the impacted groups used as the basis for these reserved buying power numbers
44
/// </summary>
45
public
IReadOnlyCollection<IPositionGroup>
ImpactedGroups
{
get
; }
46
47
/// <summary>
48
/// Gets the position changes being contemplated
49
/// </summary>
50
public
IReadOnlyCollection<IPosition>
ContemplatedChanges
{
get
; }
51
52
/// <summary>
53
/// Gets the newly resolved groups resulting from applying the contemplated changes to the impacted groups
54
/// </summary>
55
public
IReadOnlyCollection<IPositionGroup>
ContemplatedGroups
{
get
; }
56
57
/// <summary>
58
/// Initializes a new instance of the <see cref="ReservedBuyingPowerImpact"/> class
59
/// </summary>
60
/// <param name="current">The current reserved buying power for impacted groups</param>
61
/// <param name="contemplated">The reserved buying power for impacted groups after applying the contemplated changes</param>
62
/// <param name="impactedGroups">The groups impacted by the contemplated changes</param>
63
/// <param name="contemplatedChanges">The position changes being contemplated</param>
64
/// <param name="contemplatedGroups">The groups resulting from applying the contemplated changes</param>
65
public
ReservedBuyingPowerImpact
(
66
decimal current,
67
decimal contemplated,
68
IReadOnlyCollection<IPositionGroup> impactedGroups,
69
IReadOnlyCollection<IPosition> contemplatedChanges,
70
IReadOnlyCollection<IPositionGroup> contemplatedGroups
71
)
72
{
73
Current
= current;
74
Contemplated
= contemplated;
75
Delta
=
Contemplated
-
Current
;
76
ImpactedGroups
= impactedGroups;
77
ContemplatedGroups
= contemplatedGroups;
78
ContemplatedChanges
= contemplatedChanges;
79
}
80
}
81
}
Common
Securities
Positions
ReservedBuyingPowerImpact.cs
Generated by
1.8.17