forked from alpacahq/alpaca-trade-api-csharp
/
IPosition.cs
121 lines (102 loc) · 2.89 KB
/
IPosition.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
namespace Alpaca.Markets;
/// <summary>
/// Encapsulates position information from Alpaca REST API.
/// </summary>
public interface IPosition
{
/// <summary>
/// Gets unique asset identifier.
/// </summary>
[UsedImplicitly]
Guid AssetId { get; }
/// <summary>
/// Gets asset symbol.
/// </summary>
[UsedImplicitly]
String Symbol { get; }
/// <summary>
/// Gets asset exchange.
/// </summary>
[UsedImplicitly]
Exchange Exchange { get; }
/// <summary>
/// Gets asset class.
/// </summary>
[UsedImplicitly]
AssetClass AssetClass { get; }
/// <summary>
/// Gets average entry price for position.
/// </summary>
[UsedImplicitly]
Decimal AverageEntryPrice { get; }
/// <summary>
/// Get position quantity (with the fractional part).
/// </summary>
[UsedImplicitly]
Decimal Quantity { get; }
/// <summary>
/// Get position quantity (rounded to the nearest integer).
/// </summary>
[UsedImplicitly]
Int64 IntegerQuantity { get; }
/// <summary>
/// Get total number of shares available minus open orders (with the fractional part).
/// </summary>
[UsedImplicitly]
Decimal AvailableQuantity { get; }
/// <summary>
/// Get total number of shares available minus open orders (rounded to the nearest integer).
/// </summary>
[UsedImplicitly]
Int64 IntegerAvailableQuantity { get; }
/// <summary>
/// Get position side (short or long).
/// </summary>
[UsedImplicitly]
PositionSide Side { get; }
/// <summary>
/// Get current position market value.
/// </summary>
[UsedImplicitly]
Decimal? MarketValue { get; }
/// <summary>
/// Get position cost basis.
/// </summary>
[UsedImplicitly]
Decimal CostBasis { get; }
/// <summary>
/// Get position unrealized profit loss.
/// </summary>
[UsedImplicitly]
Decimal? UnrealizedProfitLoss { get; }
/// <summary>
/// Get position unrealized profit loss in percent.
/// </summary>
[UsedImplicitly]
Decimal? UnrealizedProfitLossPercent { get; }
/// <summary>
/// Get position intraday unrealized profit loss.
/// </summary>
[UsedImplicitly]
Decimal? IntradayUnrealizedProfitLoss { get; }
/// <summary>
/// Get position intraday unrealized profit loss in percent.
/// </summary>
[UsedImplicitly]
Decimal? IntradayUnrealizedProfitLossPercent { get; }
/// <summary>
/// Gets position's asset current price.
/// </summary>
[UsedImplicitly]
Decimal? AssetCurrentPrice { get; }
/// <summary>
/// Gets position's asset last trade price.
/// </summary>
[UsedImplicitly]
Decimal? AssetLastPrice { get; }
/// <summary>
/// Gets position's asset price change in percent.
/// </summary>
[UsedImplicitly]
Decimal? AssetChangePercent { get; }
}