@@ -13,8 +13,26 @@ const (
13
13
type OperationType string
14
14
15
15
const (
16
- BUY OperationType = "Buy"
17
- SELL OperationType = "Sell"
16
+ BUY OperationType = "Buy"
17
+ SELL OperationType = "Sell"
18
+ OperationTypeBrokerCommission OperationType = "BrokerCommission"
19
+ OperationTypeExchangeCommission OperationType = "ExchangeCommission"
20
+ OperationTypeServiceCommission OperationType = "ServiceCommission"
21
+ OperationTypeMarginCommission OperationType = "MarginCommission"
22
+ OperationTypeOtherCommission OperationType = "OtherCommission"
23
+ OperationTypePayIn OperationType = "PayIn"
24
+ OperationTypePayOut OperationType = "PayOut"
25
+ OperationTypeTax OperationType = "Tax"
26
+ OperationTypeTaxLucre OperationType = "TaxLucre"
27
+ OperationTypeTaxDividend OperationType = "TaxDividend"
28
+ OperationTypeTaxCoupon OperationType = "TaxCoupon"
29
+ OperationTypeTaxBack OperationType = "TaxBack"
30
+ OperationTypeRepayment OperationType = "Repayment"
31
+ OperationTypePartRepayment OperationType = "PartRepayment"
32
+ OperationTypeCoupon OperationType = "Coupon"
33
+ OperationTypeDividend OperationType = "Dividend"
34
+ OperationTypeSecurityIn OperationType = "SecurityIn"
35
+ OperationTypeSecurityOut OperationType = "SecurityOut"
18
36
)
19
37
20
38
type OrderStatus string
@@ -34,30 +52,46 @@ const (
34
52
type OperationStatus string
35
53
36
54
const (
37
- OperationStatusDone OrderStatus = "Done"
38
- OperationStatusDecline OrderStatus = "Decline"
39
- OperationStatusProgress OrderStatus = "Progress"
55
+ OperationStatusDone OperationStatus = "Done"
56
+ OperationStatusDecline OperationStatus = "Decline"
57
+ OperationStatusProgress OperationStatus = "Progress"
58
+ )
59
+
60
+ type InstrumentType string
61
+
62
+ const (
63
+ InstrumentTypeStock InstrumentType = "Stock"
64
+ InstrumentTypeCurrency InstrumentType = "Currency"
65
+ InstrumentTypeBond InstrumentType = "Bond"
66
+ InstrumentTypeEtf InstrumentType = "Etf"
67
+ )
68
+
69
+ type OrderType string
70
+
71
+ const (
72
+ OrderTypeLimit OrderType = "Limit"
73
+ OrderTypeMarket OrderType = "Market"
40
74
)
41
75
42
76
type PlacedLimitOrder struct {
43
- ID string `json:"orderId"`
44
- Operation string `json:"operation"`
45
- Status OrderStatus `json:"status"`
46
- RejectReason string `json:"rejectReason"`
47
- RequestedLots int `json:"requestedLots"`
48
- ExecutedLots int `json:"executedLots"`
49
- Commission MoneyAmount `json:"commission"`
77
+ ID string `json:"orderId"`
78
+ Operation OperationType `json:"operation"`
79
+ Status OrderStatus `json:"status"`
80
+ RejectReason string `json:"rejectReason"`
81
+ RequestedLots int `json:"requestedLots"`
82
+ ExecutedLots int `json:"executedLots"`
83
+ Commission MoneyAmount `json:"commission"`
50
84
}
51
85
52
86
type Order struct {
53
- ID string `json:"orderId"`
54
- FIGI string `json:"figi"`
55
- Operation string `json:"operation"`
56
- Status string `json:"status"`
57
- RequestedLots int `json:"requestedLots"`
58
- ExecutedLots int `json:"executedLots"`
59
- Type string `json:"type"`
60
- Price float64 `json:"price"`
87
+ ID string `json:"orderId"`
88
+ FIGI string `json:"figi"`
89
+ Operation OperationType `json:"operation"`
90
+ Status OrderStatus `json:"status"`
91
+ RequestedLots int `json:"requestedLots"`
92
+ ExecutedLots int `json:"executedLots"`
93
+ Type OrderType `json:"type"`
94
+ Price float64 `json:"price"`
61
95
}
62
96
63
97
type Portfolio struct {
@@ -72,16 +106,16 @@ type CurrencyBalance struct {
72
106
}
73
107
74
108
type PositionBalance struct {
75
- FIGI string `json:"figi"`
76
- Ticker string `json:"ticker"`
77
- ISIN string `json:"isin"`
78
- InstrumentType string `json:"instrumentType"`
79
- Balance float64 `json:"balance"`
80
- Blocked float64 `json:"blocked"`
81
- Lots int `json:"lots"`
82
- ExpectedYield MoneyAmount `json:"expectedYield"`
83
- AveragePositionPrice MoneyAmount `json:"averagePositionPrice"`
84
- AveragePositionPriceNoNkd MoneyAmount `json:"averagePositionPriceNoNkd"`
109
+ FIGI string `json:"figi"`
110
+ Ticker string `json:"ticker"`
111
+ ISIN string `json:"isin"`
112
+ InstrumentType InstrumentType `json:"instrumentType"`
113
+ Balance float64 `json:"balance"`
114
+ Blocked float64 `json:"blocked"`
115
+ Lots int `json:"lots"`
116
+ ExpectedYield MoneyAmount `json:"expectedYield"`
117
+ AveragePositionPrice MoneyAmount `json:"averagePositionPrice"`
118
+ AveragePositionPriceNoNkd MoneyAmount `json:"averagePositionPriceNoNkd"`
85
119
}
86
120
87
121
type MoneyAmount struct {
@@ -109,7 +143,7 @@ type Operation struct {
109
143
Price float64 `json:"price"`
110
144
Quantity int `json:"quantity"`
111
145
FIGI string `json:"figi"`
112
- InstrumentType string `json:"instrumentType"`
146
+ InstrumentType InstrumentType `json:"instrumentType"`
113
147
IsMarginCall bool `json:"isMarginCall"`
114
148
DateTime time.Time `json:"date"`
115
149
OperationType OperationType `json:"operationType"`
0 commit comments