ctrader-api-client 0.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- ctrader_api_client/__init__.py +64 -0
- ctrader_api_client/_internal/__init__.py +26 -0
- ctrader_api_client/_internal/messages.py +348 -0
- ctrader_api_client/_internal/proto/OpenApiCommonMessages.py +42 -0
- ctrader_api_client/_internal/proto/OpenApiCommonModelMessages.py +30 -0
- ctrader_api_client/_internal/proto/OpenApiMessages.py +1112 -0
- ctrader_api_client/_internal/proto/OpenApiModelMessages.py +802 -0
- ctrader_api_client/_internal/proto/__init__.py +320 -0
- ctrader_api_client/_internal/serialization.py +84 -0
- ctrader_api_client/api/__init__.py +21 -0
- ctrader_api_client/api/accounts.py +71 -0
- ctrader_api_client/api/market_data.py +424 -0
- ctrader_api_client/api/symbols.py +171 -0
- ctrader_api_client/api/trading.py +506 -0
- ctrader_api_client/auth/__init__.py +14 -0
- ctrader_api_client/auth/credentials.py +72 -0
- ctrader_api_client/auth/manager.py +511 -0
- ctrader_api_client/client.py +475 -0
- ctrader_api_client/config.py +56 -0
- ctrader_api_client/connection/__init__.py +16 -0
- ctrader_api_client/connection/heartbeat.py +120 -0
- ctrader_api_client/connection/protocol.py +366 -0
- ctrader_api_client/connection/transport.py +123 -0
- ctrader_api_client/enums.py +138 -0
- ctrader_api_client/events/__init__.py +65 -0
- ctrader_api_client/events/emitter.py +254 -0
- ctrader_api_client/events/router.py +400 -0
- ctrader_api_client/events/types.py +340 -0
- ctrader_api_client/exceptions.py +231 -0
- ctrader_api_client/models/__init__.py +50 -0
- ctrader_api_client/models/_base.py +19 -0
- ctrader_api_client/models/account.py +177 -0
- ctrader_api_client/models/deal.py +242 -0
- ctrader_api_client/models/market_data.py +192 -0
- ctrader_api_client/models/order.py +262 -0
- ctrader_api_client/models/position.py +209 -0
- ctrader_api_client/models/requests.py +299 -0
- ctrader_api_client/models/symbol.py +194 -0
- ctrader_api_client/py.typed +0 -0
- ctrader_api_client-0.1.0.dist-info/METADATA +252 -0
- ctrader_api_client-0.1.0.dist-info/RECORD +43 -0
- ctrader_api_client-0.1.0.dist-info/WHEEL +4 -0
- ctrader_api_client-0.1.0.dist-info/licenses/LICENSE +21 -0
|
@@ -0,0 +1,1112 @@
|
|
|
1
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
|
2
|
+
# sources: OpenApiMessages.proto
|
|
3
|
+
# plugin: python-betterproto
|
|
4
|
+
from dataclasses import dataclass
|
|
5
|
+
|
|
6
|
+
import betterproto
|
|
7
|
+
|
|
8
|
+
from .OpenApiModelMessages import (
|
|
9
|
+
ProtoOAArchivedSymbol,
|
|
10
|
+
ProtoOAAsset,
|
|
11
|
+
ProtoOAAssetClass,
|
|
12
|
+
ProtoOABonusDepositWithdraw,
|
|
13
|
+
ProtoOAClientPermissionScope,
|
|
14
|
+
ProtoOACtidProfile,
|
|
15
|
+
ProtoOACtidTraderAccount,
|
|
16
|
+
ProtoOADeal,
|
|
17
|
+
ProtoOADealOffset,
|
|
18
|
+
ProtoOADepositWithdraw,
|
|
19
|
+
ProtoOADepthQuote,
|
|
20
|
+
ProtoOADynamicLeverage,
|
|
21
|
+
ProtoOAExecutionType,
|
|
22
|
+
ProtoOAExpectedMargin,
|
|
23
|
+
ProtoOALightSymbol,
|
|
24
|
+
ProtoOAMarginCall,
|
|
25
|
+
ProtoOAOrder,
|
|
26
|
+
ProtoOAOrderTriggerMethod,
|
|
27
|
+
ProtoOAOrderType,
|
|
28
|
+
ProtoOAPayloadType,
|
|
29
|
+
ProtoOAPosition,
|
|
30
|
+
ProtoOAPositionUnrealizedPnL,
|
|
31
|
+
ProtoOAQuoteType,
|
|
32
|
+
ProtoOASymbol,
|
|
33
|
+
ProtoOASymbolCategory,
|
|
34
|
+
ProtoOATickData,
|
|
35
|
+
ProtoOATimeInForce,
|
|
36
|
+
ProtoOATrader,
|
|
37
|
+
ProtoOATradeSide,
|
|
38
|
+
ProtoOATrendbar,
|
|
39
|
+
ProtoOATrendbarPeriod,
|
|
40
|
+
)
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
@dataclass
|
|
44
|
+
class ProtoOAApplicationAuthReq(betterproto.Message):
|
|
45
|
+
"""
|
|
46
|
+
* Request for the authorizing an application to work with the cTrader
|
|
47
|
+
platform Proxies.
|
|
48
|
+
"""
|
|
49
|
+
|
|
50
|
+
payload_type: "ProtoOAPayloadType" = betterproto.enum_field(1)
|
|
51
|
+
client_id: str = betterproto.string_field(2)
|
|
52
|
+
client_secret: str = betterproto.string_field(3)
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
@dataclass
|
|
56
|
+
class ProtoOAApplicationAuthRes(betterproto.Message):
|
|
57
|
+
"""* Response to the ProtoOAApplicationAuthReq request."""
|
|
58
|
+
|
|
59
|
+
payload_type: "ProtoOAPayloadType" = betterproto.enum_field(1)
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
@dataclass
|
|
63
|
+
class ProtoOAAccountAuthReq(betterproto.Message):
|
|
64
|
+
"""
|
|
65
|
+
* Request for authorizing of the trading account session. Requires
|
|
66
|
+
established authorized connection with the client application using
|
|
67
|
+
ProtoOAApplicationAuthReq.
|
|
68
|
+
"""
|
|
69
|
+
|
|
70
|
+
payload_type: "ProtoOAPayloadType" = betterproto.enum_field(1)
|
|
71
|
+
ctid_trader_account_id: int = betterproto.int64_field(2)
|
|
72
|
+
access_token: str = betterproto.string_field(3)
|
|
73
|
+
|
|
74
|
+
|
|
75
|
+
@dataclass
|
|
76
|
+
class ProtoOAAccountAuthRes(betterproto.Message):
|
|
77
|
+
"""* Response to the ProtoOAApplicationAuthRes request."""
|
|
78
|
+
|
|
79
|
+
payload_type: "ProtoOAPayloadType" = betterproto.enum_field(1)
|
|
80
|
+
ctid_trader_account_id: int = betterproto.int64_field(2)
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
@dataclass
|
|
84
|
+
class ProtoOAErrorRes(betterproto.Message):
|
|
85
|
+
"""* Generic response when an ERROR occurred."""
|
|
86
|
+
|
|
87
|
+
payload_type: "ProtoOAPayloadType" = betterproto.enum_field(1)
|
|
88
|
+
ctid_trader_account_id: int = betterproto.int64_field(2)
|
|
89
|
+
error_code: str = betterproto.string_field(3)
|
|
90
|
+
description: str = betterproto.string_field(4)
|
|
91
|
+
maintenance_end_timestamp: int = betterproto.int64_field(5)
|
|
92
|
+
retry_after: int = betterproto.uint64_field(6)
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
@dataclass
|
|
96
|
+
class ProtoOAClientDisconnectEvent(betterproto.Message):
|
|
97
|
+
"""
|
|
98
|
+
* Event that is sent when the connection with the client application is
|
|
99
|
+
cancelled by the server. All the sessions for the traders' accounts will be
|
|
100
|
+
terminated.
|
|
101
|
+
"""
|
|
102
|
+
|
|
103
|
+
payload_type: "ProtoOAPayloadType" = betterproto.enum_field(1)
|
|
104
|
+
reason: str = betterproto.string_field(2)
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
@dataclass
|
|
108
|
+
class ProtoOAAccountsTokenInvalidatedEvent(betterproto.Message):
|
|
109
|
+
"""
|
|
110
|
+
* Event that is sent when a session to a specific trader's account is
|
|
111
|
+
terminated by the server but the existing connections with the other
|
|
112
|
+
trader's accounts are maintained. Reasons to trigger: account was deleted,
|
|
113
|
+
cTID was deleted, token was refreshed, token was revoked.
|
|
114
|
+
"""
|
|
115
|
+
|
|
116
|
+
payload_type: "ProtoOAPayloadType" = betterproto.enum_field(1)
|
|
117
|
+
ctid_trader_account_ids: list[int] = betterproto.int64_field(2)
|
|
118
|
+
reason: str = betterproto.string_field(3)
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
@dataclass
|
|
122
|
+
class ProtoOAVersionReq(betterproto.Message):
|
|
123
|
+
"""
|
|
124
|
+
* Request for getting the proxy version. Can be used to check the current
|
|
125
|
+
version of the Open API scheme.
|
|
126
|
+
"""
|
|
127
|
+
|
|
128
|
+
payload_type: "ProtoOAPayloadType" = betterproto.enum_field(1)
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
@dataclass
|
|
132
|
+
class ProtoOAVersionRes(betterproto.Message):
|
|
133
|
+
"""* Response to the ProtoOAVersionReq request."""
|
|
134
|
+
|
|
135
|
+
payload_type: "ProtoOAPayloadType" = betterproto.enum_field(1)
|
|
136
|
+
version: str = betterproto.string_field(2)
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
@dataclass
|
|
140
|
+
class ProtoOANewOrderReq(betterproto.Message):
|
|
141
|
+
"""
|
|
142
|
+
* Request for sending a new trading order. Allowed only if the accessToken
|
|
143
|
+
has the "trade" permissions for the trading account.
|
|
144
|
+
"""
|
|
145
|
+
|
|
146
|
+
payload_type: "ProtoOAPayloadType" = betterproto.enum_field(1)
|
|
147
|
+
ctid_trader_account_id: int = betterproto.int64_field(2)
|
|
148
|
+
symbol_id: int = betterproto.int64_field(3)
|
|
149
|
+
order_type: "ProtoOAOrderType" = betterproto.enum_field(4)
|
|
150
|
+
trade_side: "ProtoOATradeSide" = betterproto.enum_field(5)
|
|
151
|
+
volume: int = betterproto.int64_field(6)
|
|
152
|
+
limit_price: float = betterproto.double_field(7)
|
|
153
|
+
stop_price: float = betterproto.double_field(8)
|
|
154
|
+
time_in_force: "ProtoOATimeInForce" = betterproto.enum_field(9)
|
|
155
|
+
expiration_timestamp: int = betterproto.int64_field(10)
|
|
156
|
+
stop_loss: float = betterproto.double_field(11)
|
|
157
|
+
take_profit: float = betterproto.double_field(12)
|
|
158
|
+
comment: str = betterproto.string_field(13)
|
|
159
|
+
base_slippage_price: float = betterproto.double_field(14)
|
|
160
|
+
slippage_in_points: int = betterproto.int32_field(15)
|
|
161
|
+
label: str = betterproto.string_field(16)
|
|
162
|
+
position_id: int = betterproto.int64_field(17)
|
|
163
|
+
client_order_id: str = betterproto.string_field(18)
|
|
164
|
+
relative_stop_loss: int = betterproto.int64_field(19)
|
|
165
|
+
relative_take_profit: int = betterproto.int64_field(20)
|
|
166
|
+
guaranteed_stop_loss: bool = betterproto.bool_field(21)
|
|
167
|
+
trailing_stop_loss: bool = betterproto.bool_field(22)
|
|
168
|
+
stop_trigger_method: "ProtoOAOrderTriggerMethod" = betterproto.enum_field(23)
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
@dataclass
|
|
172
|
+
class ProtoOAExecutionEvent(betterproto.Message):
|
|
173
|
+
"""
|
|
174
|
+
* Event that is sent following the successful order acceptance or execution
|
|
175
|
+
by the server. Acts as response to the ProtoOANewOrderReq,
|
|
176
|
+
ProtoOACancelOrderReq, ProtoOAAmendOrderReq, ProtoOAAmendPositionSLTPReq,
|
|
177
|
+
ProtoOAClosePositionReq requests. Also, the event is sent when a
|
|
178
|
+
Deposit/Withdrawal took place.
|
|
179
|
+
"""
|
|
180
|
+
|
|
181
|
+
payload_type: "ProtoOAPayloadType" = betterproto.enum_field(1)
|
|
182
|
+
ctid_trader_account_id: int = betterproto.int64_field(2)
|
|
183
|
+
execution_type: "ProtoOAExecutionType" = betterproto.enum_field(3)
|
|
184
|
+
position: "ProtoOAPosition" = betterproto.message_field(4)
|
|
185
|
+
order: "ProtoOAOrder" = betterproto.message_field(5)
|
|
186
|
+
deal: "ProtoOADeal" = betterproto.message_field(6)
|
|
187
|
+
bonus_deposit_withdraw: "ProtoOABonusDepositWithdraw" = betterproto.message_field(7)
|
|
188
|
+
deposit_withdraw: "ProtoOADepositWithdraw" = betterproto.message_field(8)
|
|
189
|
+
error_code: str = betterproto.string_field(9)
|
|
190
|
+
is_server_event: bool = betterproto.bool_field(10)
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
@dataclass
|
|
194
|
+
class ProtoOACancelOrderReq(betterproto.Message):
|
|
195
|
+
"""
|
|
196
|
+
* Request for cancelling existing pending order. Allowed only if the
|
|
197
|
+
accessToken has "trade" permissions for the trading account.
|
|
198
|
+
"""
|
|
199
|
+
|
|
200
|
+
payload_type: "ProtoOAPayloadType" = betterproto.enum_field(1)
|
|
201
|
+
ctid_trader_account_id: int = betterproto.int64_field(2)
|
|
202
|
+
order_id: int = betterproto.int64_field(3)
|
|
203
|
+
|
|
204
|
+
|
|
205
|
+
@dataclass
|
|
206
|
+
class ProtoOAAmendOrderReq(betterproto.Message):
|
|
207
|
+
"""
|
|
208
|
+
* Request for amending the existing pending order. Allowed only if the
|
|
209
|
+
Access Token has "trade" permissions for the trading account.
|
|
210
|
+
"""
|
|
211
|
+
|
|
212
|
+
payload_type: "ProtoOAPayloadType" = betterproto.enum_field(1)
|
|
213
|
+
ctid_trader_account_id: int = betterproto.int64_field(2)
|
|
214
|
+
order_id: int = betterproto.int64_field(3)
|
|
215
|
+
volume: int = betterproto.int64_field(4)
|
|
216
|
+
limit_price: float = betterproto.double_field(5)
|
|
217
|
+
stop_price: float = betterproto.double_field(6)
|
|
218
|
+
expiration_timestamp: int = betterproto.int64_field(7)
|
|
219
|
+
stop_loss: float = betterproto.double_field(8)
|
|
220
|
+
take_profit: float = betterproto.double_field(9)
|
|
221
|
+
slippage_in_points: int = betterproto.int32_field(10)
|
|
222
|
+
relative_stop_loss: int = betterproto.int64_field(11)
|
|
223
|
+
relative_take_profit: int = betterproto.int64_field(12)
|
|
224
|
+
guaranteed_stop_loss: bool = betterproto.bool_field(13)
|
|
225
|
+
trailing_stop_loss: bool = betterproto.bool_field(14)
|
|
226
|
+
stop_trigger_method: "ProtoOAOrderTriggerMethod" = betterproto.enum_field(15)
|
|
227
|
+
|
|
228
|
+
|
|
229
|
+
@dataclass
|
|
230
|
+
class ProtoOAAmendPositionSLTPReq(betterproto.Message):
|
|
231
|
+
"""
|
|
232
|
+
* Request for amending StopLoss and TakeProfit of existing position.
|
|
233
|
+
Allowed only if the accessToken has "trade" permissions for the trading
|
|
234
|
+
account.
|
|
235
|
+
"""
|
|
236
|
+
|
|
237
|
+
payload_type: "ProtoOAPayloadType" = betterproto.enum_field(1)
|
|
238
|
+
ctid_trader_account_id: int = betterproto.int64_field(2)
|
|
239
|
+
position_id: int = betterproto.int64_field(3)
|
|
240
|
+
stop_loss: float = betterproto.double_field(4)
|
|
241
|
+
take_profit: float = betterproto.double_field(5)
|
|
242
|
+
guaranteed_stop_loss: bool = betterproto.bool_field(7)
|
|
243
|
+
trailing_stop_loss: bool = betterproto.bool_field(8)
|
|
244
|
+
stop_loss_trigger_method: "ProtoOAOrderTriggerMethod" = betterproto.enum_field(9)
|
|
245
|
+
|
|
246
|
+
|
|
247
|
+
@dataclass
|
|
248
|
+
class ProtoOAClosePositionReq(betterproto.Message):
|
|
249
|
+
"""
|
|
250
|
+
* Request for closing or partially closing of an existing position. Allowed
|
|
251
|
+
only if the accessToken has "trade" permissions for the trading account.
|
|
252
|
+
"""
|
|
253
|
+
|
|
254
|
+
payload_type: "ProtoOAPayloadType" = betterproto.enum_field(1)
|
|
255
|
+
ctid_trader_account_id: int = betterproto.int64_field(2)
|
|
256
|
+
position_id: int = betterproto.int64_field(3)
|
|
257
|
+
volume: int = betterproto.int64_field(4)
|
|
258
|
+
|
|
259
|
+
|
|
260
|
+
@dataclass
|
|
261
|
+
class ProtoOATrailingSLChangedEvent(betterproto.Message):
|
|
262
|
+
"""
|
|
263
|
+
* Event that is sent when the level of the Trailing Stop Loss is changed
|
|
264
|
+
due to the price level changes.
|
|
265
|
+
"""
|
|
266
|
+
|
|
267
|
+
payload_type: "ProtoOAPayloadType" = betterproto.enum_field(1)
|
|
268
|
+
ctid_trader_account_id: int = betterproto.int64_field(2)
|
|
269
|
+
position_id: int = betterproto.int64_field(3)
|
|
270
|
+
order_id: int = betterproto.int64_field(4)
|
|
271
|
+
stop_price: float = betterproto.double_field(5)
|
|
272
|
+
utc_last_update_timestamp: int = betterproto.int64_field(6)
|
|
273
|
+
|
|
274
|
+
|
|
275
|
+
@dataclass
|
|
276
|
+
class ProtoOAAssetListReq(betterproto.Message):
|
|
277
|
+
"""* Request for the list of assets available for a trader's account."""
|
|
278
|
+
|
|
279
|
+
payload_type: "ProtoOAPayloadType" = betterproto.enum_field(1)
|
|
280
|
+
ctid_trader_account_id: int = betterproto.int64_field(2)
|
|
281
|
+
|
|
282
|
+
|
|
283
|
+
@dataclass
|
|
284
|
+
class ProtoOAAssetListRes(betterproto.Message):
|
|
285
|
+
"""* Response to the ProtoOAAssetListReq request."""
|
|
286
|
+
|
|
287
|
+
payload_type: "ProtoOAPayloadType" = betterproto.enum_field(1)
|
|
288
|
+
ctid_trader_account_id: int = betterproto.int64_field(2)
|
|
289
|
+
asset: list["ProtoOAAsset"] = betterproto.message_field(3)
|
|
290
|
+
|
|
291
|
+
|
|
292
|
+
@dataclass
|
|
293
|
+
class ProtoOASymbolsListReq(betterproto.Message):
|
|
294
|
+
"""
|
|
295
|
+
* Request for a list of symbols available for a trading account. Symbol
|
|
296
|
+
entries are returned with the limited set of fields.
|
|
297
|
+
"""
|
|
298
|
+
|
|
299
|
+
payload_type: "ProtoOAPayloadType" = betterproto.enum_field(1)
|
|
300
|
+
ctid_trader_account_id: int = betterproto.int64_field(2)
|
|
301
|
+
include_archived_symbols: bool = betterproto.bool_field(3)
|
|
302
|
+
|
|
303
|
+
|
|
304
|
+
@dataclass
|
|
305
|
+
class ProtoOASymbolsListRes(betterproto.Message):
|
|
306
|
+
"""* Response to the ProtoOASymbolsListReq request."""
|
|
307
|
+
|
|
308
|
+
payload_type: "ProtoOAPayloadType" = betterproto.enum_field(1)
|
|
309
|
+
ctid_trader_account_id: int = betterproto.int64_field(2)
|
|
310
|
+
symbol: list["ProtoOALightSymbol"] = betterproto.message_field(3)
|
|
311
|
+
archived_symbol: list["ProtoOAArchivedSymbol"] = betterproto.message_field(4)
|
|
312
|
+
|
|
313
|
+
|
|
314
|
+
@dataclass
|
|
315
|
+
class ProtoOASymbolByIdReq(betterproto.Message):
|
|
316
|
+
"""* Request for getting a full symbol entity."""
|
|
317
|
+
|
|
318
|
+
payload_type: "ProtoOAPayloadType" = betterproto.enum_field(1)
|
|
319
|
+
ctid_trader_account_id: int = betterproto.int64_field(2)
|
|
320
|
+
symbol_id: list[int] = betterproto.int64_field(3)
|
|
321
|
+
|
|
322
|
+
|
|
323
|
+
@dataclass
|
|
324
|
+
class ProtoOASymbolByIdRes(betterproto.Message):
|
|
325
|
+
"""* Response to the ProtoOASymbolByIdReq request."""
|
|
326
|
+
|
|
327
|
+
payload_type: "ProtoOAPayloadType" = betterproto.enum_field(1)
|
|
328
|
+
ctid_trader_account_id: int = betterproto.int64_field(2)
|
|
329
|
+
symbol: list["ProtoOASymbol"] = betterproto.message_field(3)
|
|
330
|
+
archived_symbol: list["ProtoOAArchivedSymbol"] = betterproto.message_field(4)
|
|
331
|
+
|
|
332
|
+
|
|
333
|
+
@dataclass
|
|
334
|
+
class ProtoOASymbolsForConversionReq(betterproto.Message):
|
|
335
|
+
"""
|
|
336
|
+
* Request for getting a conversion chain between two assets that consists
|
|
337
|
+
of several symbols. Use when no direct quote is available.
|
|
338
|
+
"""
|
|
339
|
+
|
|
340
|
+
payload_type: "ProtoOAPayloadType" = betterproto.enum_field(1)
|
|
341
|
+
ctid_trader_account_id: int = betterproto.int64_field(2)
|
|
342
|
+
first_asset_id: int = betterproto.int64_field(3)
|
|
343
|
+
last_asset_id: int = betterproto.int64_field(4)
|
|
344
|
+
|
|
345
|
+
|
|
346
|
+
@dataclass
|
|
347
|
+
class ProtoOASymbolsForConversionRes(betterproto.Message):
|
|
348
|
+
"""* Response to the ProtoOASymbolsForConversionReq request."""
|
|
349
|
+
|
|
350
|
+
payload_type: "ProtoOAPayloadType" = betterproto.enum_field(1)
|
|
351
|
+
ctid_trader_account_id: int = betterproto.int64_field(2)
|
|
352
|
+
symbol: list["ProtoOALightSymbol"] = betterproto.message_field(3)
|
|
353
|
+
|
|
354
|
+
|
|
355
|
+
@dataclass
|
|
356
|
+
class ProtoOASymbolChangedEvent(betterproto.Message):
|
|
357
|
+
"""* Event that is sent when the symbol is changed on the Server side."""
|
|
358
|
+
|
|
359
|
+
payload_type: "ProtoOAPayloadType" = betterproto.enum_field(1)
|
|
360
|
+
ctid_trader_account_id: int = betterproto.int64_field(2)
|
|
361
|
+
symbol_id: list[int] = betterproto.int64_field(3)
|
|
362
|
+
|
|
363
|
+
|
|
364
|
+
@dataclass
|
|
365
|
+
class ProtoOAAssetClassListReq(betterproto.Message):
|
|
366
|
+
"""
|
|
367
|
+
* Request for a list of asset classes available for the trader's account.
|
|
368
|
+
"""
|
|
369
|
+
|
|
370
|
+
payload_type: "ProtoOAPayloadType" = betterproto.enum_field(1)
|
|
371
|
+
ctid_trader_account_id: int = betterproto.int64_field(2)
|
|
372
|
+
|
|
373
|
+
|
|
374
|
+
@dataclass
|
|
375
|
+
class ProtoOAAssetClassListRes(betterproto.Message):
|
|
376
|
+
"""* Response to the ProtoOAAssetListReq request."""
|
|
377
|
+
|
|
378
|
+
payload_type: "ProtoOAPayloadType" = betterproto.enum_field(1)
|
|
379
|
+
ctid_trader_account_id: int = betterproto.int64_field(2)
|
|
380
|
+
asset_class: list["ProtoOAAssetClass"] = betterproto.message_field(3)
|
|
381
|
+
|
|
382
|
+
|
|
383
|
+
@dataclass
|
|
384
|
+
class ProtoOATraderReq(betterproto.Message):
|
|
385
|
+
"""* Request for getting data of Trader's Account."""
|
|
386
|
+
|
|
387
|
+
payload_type: "ProtoOAPayloadType" = betterproto.enum_field(1)
|
|
388
|
+
ctid_trader_account_id: int = betterproto.int64_field(2)
|
|
389
|
+
|
|
390
|
+
|
|
391
|
+
@dataclass
|
|
392
|
+
class ProtoOATraderRes(betterproto.Message):
|
|
393
|
+
"""* Response to the ProtoOATraderReq request."""
|
|
394
|
+
|
|
395
|
+
payload_type: "ProtoOAPayloadType" = betterproto.enum_field(1)
|
|
396
|
+
ctid_trader_account_id: int = betterproto.int64_field(2)
|
|
397
|
+
trader: "ProtoOATrader" = betterproto.message_field(3)
|
|
398
|
+
|
|
399
|
+
|
|
400
|
+
@dataclass
|
|
401
|
+
class ProtoOATraderUpdatedEvent(betterproto.Message):
|
|
402
|
+
"""* Event that is sent when a Trader is updated on Server side."""
|
|
403
|
+
|
|
404
|
+
payload_type: "ProtoOAPayloadType" = betterproto.enum_field(1)
|
|
405
|
+
ctid_trader_account_id: int = betterproto.int64_field(2)
|
|
406
|
+
trader: "ProtoOATrader" = betterproto.message_field(3)
|
|
407
|
+
|
|
408
|
+
|
|
409
|
+
@dataclass
|
|
410
|
+
class ProtoOAReconcileReq(betterproto.Message):
|
|
411
|
+
"""
|
|
412
|
+
* Request for getting Trader's current open positions and pending orders
|
|
413
|
+
data.
|
|
414
|
+
"""
|
|
415
|
+
|
|
416
|
+
payload_type: "ProtoOAPayloadType" = betterproto.enum_field(1)
|
|
417
|
+
ctid_trader_account_id: int = betterproto.int64_field(2)
|
|
418
|
+
return_protection_orders: bool = betterproto.bool_field(3)
|
|
419
|
+
|
|
420
|
+
|
|
421
|
+
@dataclass
|
|
422
|
+
class ProtoOAReconcileRes(betterproto.Message):
|
|
423
|
+
"""* The response to the ProtoOAReconcileReq request."""
|
|
424
|
+
|
|
425
|
+
payload_type: "ProtoOAPayloadType" = betterproto.enum_field(1)
|
|
426
|
+
ctid_trader_account_id: int = betterproto.int64_field(2)
|
|
427
|
+
position: list["ProtoOAPosition"] = betterproto.message_field(3)
|
|
428
|
+
order: list["ProtoOAOrder"] = betterproto.message_field(4)
|
|
429
|
+
|
|
430
|
+
|
|
431
|
+
@dataclass
|
|
432
|
+
class ProtoOAOrderErrorEvent(betterproto.Message):
|
|
433
|
+
"""* Event that is sent when errors occur during the order requests."""
|
|
434
|
+
|
|
435
|
+
payload_type: "ProtoOAPayloadType" = betterproto.enum_field(1)
|
|
436
|
+
ctid_trader_account_id: int = betterproto.int64_field(5)
|
|
437
|
+
error_code: str = betterproto.string_field(2)
|
|
438
|
+
order_id: int = betterproto.int64_field(3)
|
|
439
|
+
position_id: int = betterproto.int64_field(6)
|
|
440
|
+
description: str = betterproto.string_field(7)
|
|
441
|
+
|
|
442
|
+
|
|
443
|
+
@dataclass
|
|
444
|
+
class ProtoOADealListReq(betterproto.Message):
|
|
445
|
+
"""
|
|
446
|
+
* Request for getting Trader's deals historical data (execution details).
|
|
447
|
+
"""
|
|
448
|
+
|
|
449
|
+
payload_type: "ProtoOAPayloadType" = betterproto.enum_field(1)
|
|
450
|
+
ctid_trader_account_id: int = betterproto.int64_field(2)
|
|
451
|
+
from_timestamp: int = betterproto.int64_field(3)
|
|
452
|
+
to_timestamp: int = betterproto.int64_field(4)
|
|
453
|
+
max_rows: int = betterproto.int32_field(5)
|
|
454
|
+
|
|
455
|
+
|
|
456
|
+
@dataclass
|
|
457
|
+
class ProtoOADealListRes(betterproto.Message):
|
|
458
|
+
"""* The response to the ProtoOADealListRes request."""
|
|
459
|
+
|
|
460
|
+
payload_type: "ProtoOAPayloadType" = betterproto.enum_field(1)
|
|
461
|
+
ctid_trader_account_id: int = betterproto.int64_field(2)
|
|
462
|
+
deal: list["ProtoOADeal"] = betterproto.message_field(3)
|
|
463
|
+
has_more: bool = betterproto.bool_field(4)
|
|
464
|
+
|
|
465
|
+
|
|
466
|
+
@dataclass
|
|
467
|
+
class ProtoOAOrderListReq(betterproto.Message):
|
|
468
|
+
"""* Request for getting Trader's orders filtered by timestamp"""
|
|
469
|
+
|
|
470
|
+
payload_type: "ProtoOAPayloadType" = betterproto.enum_field(1)
|
|
471
|
+
ctid_trader_account_id: int = betterproto.int64_field(2)
|
|
472
|
+
from_timestamp: int = betterproto.int64_field(3)
|
|
473
|
+
to_timestamp: int = betterproto.int64_field(4)
|
|
474
|
+
|
|
475
|
+
|
|
476
|
+
@dataclass
|
|
477
|
+
class ProtoOAOrderListRes(betterproto.Message):
|
|
478
|
+
"""* The response to the ProtoOAOrderListReq request."""
|
|
479
|
+
|
|
480
|
+
payload_type: "ProtoOAPayloadType" = betterproto.enum_field(1)
|
|
481
|
+
ctid_trader_account_id: int = betterproto.int64_field(2)
|
|
482
|
+
order: list["ProtoOAOrder"] = betterproto.message_field(3)
|
|
483
|
+
has_more: bool = betterproto.bool_field(4)
|
|
484
|
+
|
|
485
|
+
|
|
486
|
+
@dataclass
|
|
487
|
+
class ProtoOAExpectedMarginReq(betterproto.Message):
|
|
488
|
+
"""
|
|
489
|
+
* Request for getting the margin estimate according to leverage profiles.
|
|
490
|
+
Can be used before sending a new order request. This doesn't consider
|
|
491
|
+
ACCORDING_TO_GSL margin calculation type, as this calculation is trivial:
|
|
492
|
+
usedMargin = (VWAP price of the position - GSL price) * volume *
|
|
493
|
+
Quote2Deposit.
|
|
494
|
+
"""
|
|
495
|
+
|
|
496
|
+
payload_type: "ProtoOAPayloadType" = betterproto.enum_field(1)
|
|
497
|
+
ctid_trader_account_id: int = betterproto.int64_field(2)
|
|
498
|
+
symbol_id: int = betterproto.int64_field(3)
|
|
499
|
+
volume: list[int] = betterproto.int64_field(4)
|
|
500
|
+
|
|
501
|
+
|
|
502
|
+
@dataclass
|
|
503
|
+
class ProtoOAExpectedMarginRes(betterproto.Message):
|
|
504
|
+
"""* The response to the ProtoOAExpectedMarginReq request."""
|
|
505
|
+
|
|
506
|
+
payload_type: "ProtoOAPayloadType" = betterproto.enum_field(1)
|
|
507
|
+
ctid_trader_account_id: int = betterproto.int64_field(2)
|
|
508
|
+
margin: list["ProtoOAExpectedMargin"] = betterproto.message_field(3)
|
|
509
|
+
money_digits: int = betterproto.uint32_field(4)
|
|
510
|
+
|
|
511
|
+
|
|
512
|
+
@dataclass
|
|
513
|
+
class ProtoOAMarginChangedEvent(betterproto.Message):
|
|
514
|
+
"""
|
|
515
|
+
* Event that is sent when the margin allocated to a specific position is
|
|
516
|
+
changed.
|
|
517
|
+
"""
|
|
518
|
+
|
|
519
|
+
payload_type: "ProtoOAPayloadType" = betterproto.enum_field(1)
|
|
520
|
+
ctid_trader_account_id: int = betterproto.int64_field(2)
|
|
521
|
+
position_id: int = betterproto.uint64_field(3)
|
|
522
|
+
used_margin: int = betterproto.uint64_field(4)
|
|
523
|
+
money_digits: int = betterproto.uint32_field(5)
|
|
524
|
+
|
|
525
|
+
|
|
526
|
+
@dataclass
|
|
527
|
+
class ProtoOACashFlowHistoryListReq(betterproto.Message):
|
|
528
|
+
"""
|
|
529
|
+
* Request for getting Trader's historical data of deposits and withdrawals.
|
|
530
|
+
"""
|
|
531
|
+
|
|
532
|
+
payload_type: "ProtoOAPayloadType" = betterproto.enum_field(1)
|
|
533
|
+
ctid_trader_account_id: int = betterproto.int64_field(2)
|
|
534
|
+
from_timestamp: int = betterproto.int64_field(3)
|
|
535
|
+
to_timestamp: int = betterproto.int64_field(4)
|
|
536
|
+
|
|
537
|
+
|
|
538
|
+
@dataclass
|
|
539
|
+
class ProtoOACashFlowHistoryListRes(betterproto.Message):
|
|
540
|
+
"""* Response to the ProtoOACashFlowHistoryListReq request."""
|
|
541
|
+
|
|
542
|
+
payload_type: "ProtoOAPayloadType" = betterproto.enum_field(1)
|
|
543
|
+
ctid_trader_account_id: int = betterproto.int64_field(2)
|
|
544
|
+
deposit_withdraw: list["ProtoOADepositWithdraw"] = betterproto.message_field(3)
|
|
545
|
+
|
|
546
|
+
|
|
547
|
+
@dataclass
|
|
548
|
+
class ProtoOAGetAccountListByAccessTokenReq(betterproto.Message):
|
|
549
|
+
"""
|
|
550
|
+
* Request for getting the list of granted trader's account for the access
|
|
551
|
+
token.
|
|
552
|
+
"""
|
|
553
|
+
|
|
554
|
+
payload_type: "ProtoOAPayloadType" = betterproto.enum_field(1)
|
|
555
|
+
access_token: str = betterproto.string_field(2)
|
|
556
|
+
|
|
557
|
+
|
|
558
|
+
@dataclass
|
|
559
|
+
class ProtoOAGetAccountListByAccessTokenRes(betterproto.Message):
|
|
560
|
+
"""* Response to the ProtoOAGetAccountListByAccessTokenReq request."""
|
|
561
|
+
|
|
562
|
+
payload_type: "ProtoOAPayloadType" = betterproto.enum_field(1)
|
|
563
|
+
access_token: str = betterproto.string_field(2)
|
|
564
|
+
permission_scope: "ProtoOAClientPermissionScope" = betterproto.enum_field(3)
|
|
565
|
+
ctid_trader_account: list["ProtoOACtidTraderAccount"] = betterproto.message_field(4)
|
|
566
|
+
|
|
567
|
+
|
|
568
|
+
@dataclass
|
|
569
|
+
class ProtoOARefreshTokenReq(betterproto.Message):
|
|
570
|
+
"""
|
|
571
|
+
* Request to refresh the access token using refresh token of granted
|
|
572
|
+
trader's account.
|
|
573
|
+
"""
|
|
574
|
+
|
|
575
|
+
payload_type: "ProtoOAPayloadType" = betterproto.enum_field(1)
|
|
576
|
+
refresh_token: str = betterproto.string_field(2)
|
|
577
|
+
|
|
578
|
+
|
|
579
|
+
@dataclass
|
|
580
|
+
class ProtoOARefreshTokenRes(betterproto.Message):
|
|
581
|
+
"""* Response to the ProtoOARefreshTokenReq request."""
|
|
582
|
+
|
|
583
|
+
payload_type: "ProtoOAPayloadType" = betterproto.enum_field(1)
|
|
584
|
+
access_token: str = betterproto.string_field(2)
|
|
585
|
+
token_type: str = betterproto.string_field(3)
|
|
586
|
+
expires_in: int = betterproto.int64_field(4)
|
|
587
|
+
refresh_token: str = betterproto.string_field(5)
|
|
588
|
+
|
|
589
|
+
|
|
590
|
+
@dataclass
|
|
591
|
+
class ProtoOASubscribeSpotsReq(betterproto.Message):
|
|
592
|
+
"""
|
|
593
|
+
* Request for subscribing on spot events of the specified symbol. After
|
|
594
|
+
successful subscription you'll receive technical ProtoOASpotEvent with
|
|
595
|
+
latest price, after which you'll start receiving updates on prices via
|
|
596
|
+
consequent ProtoOASpotEvents.
|
|
597
|
+
"""
|
|
598
|
+
|
|
599
|
+
payload_type: "ProtoOAPayloadType" = betterproto.enum_field(1)
|
|
600
|
+
ctid_trader_account_id: int = betterproto.int64_field(2)
|
|
601
|
+
symbol_id: list[int] = betterproto.int64_field(3)
|
|
602
|
+
subscribe_to_spot_timestamp: bool = betterproto.bool_field(4)
|
|
603
|
+
|
|
604
|
+
|
|
605
|
+
@dataclass
|
|
606
|
+
class ProtoOASubscribeSpotsRes(betterproto.Message):
|
|
607
|
+
"""
|
|
608
|
+
* Response to the ProtoOASubscribeSpotsReq request. Reflects that your
|
|
609
|
+
request to subscribe for symbol has been added to queue. You'll receive
|
|
610
|
+
technical ProtoOASpotEvent with current price shortly after this response.
|
|
611
|
+
"""
|
|
612
|
+
|
|
613
|
+
payload_type: "ProtoOAPayloadType" = betterproto.enum_field(1)
|
|
614
|
+
ctid_trader_account_id: int = betterproto.int64_field(2)
|
|
615
|
+
|
|
616
|
+
|
|
617
|
+
@dataclass
|
|
618
|
+
class ProtoOAUnsubscribeSpotsReq(betterproto.Message):
|
|
619
|
+
"""
|
|
620
|
+
* Request for unsubscribing from the spot events of the specified symbol.
|
|
621
|
+
Request to stop receiving ProtoOASpotEvents related to particular symbols.
|
|
622
|
+
Unsubscription is useful to minimize traffic, especially during high
|
|
623
|
+
volatility events.
|
|
624
|
+
"""
|
|
625
|
+
|
|
626
|
+
payload_type: "ProtoOAPayloadType" = betterproto.enum_field(1)
|
|
627
|
+
ctid_trader_account_id: int = betterproto.int64_field(2)
|
|
628
|
+
symbol_id: list[int] = betterproto.int64_field(3)
|
|
629
|
+
|
|
630
|
+
|
|
631
|
+
@dataclass
|
|
632
|
+
class ProtoOAUnsubscribeSpotsRes(betterproto.Message):
|
|
633
|
+
"""
|
|
634
|
+
* Response to the ProtoOASubscribeSpotsRes request. Reflects that your
|
|
635
|
+
request to unsubscribe will has been added to queue and will be completed
|
|
636
|
+
shortly. You may still occasionally receive ProtoOASpotEvents until request
|
|
637
|
+
processing is complete.
|
|
638
|
+
"""
|
|
639
|
+
|
|
640
|
+
payload_type: "ProtoOAPayloadType" = betterproto.enum_field(1)
|
|
641
|
+
ctid_trader_account_id: int = betterproto.int64_field(2)
|
|
642
|
+
|
|
643
|
+
|
|
644
|
+
@dataclass
|
|
645
|
+
class ProtoOASpotEvent(betterproto.Message):
|
|
646
|
+
"""
|
|
647
|
+
* Event that is sent when a new spot event is generated on the server side.
|
|
648
|
+
Requires subscription on the spot events, see ProtoOASubscribeSpotsReq.
|
|
649
|
+
First event, received after subscription will contain latest spot prices
|
|
650
|
+
even if market is closed.
|
|
651
|
+
"""
|
|
652
|
+
|
|
653
|
+
payload_type: "ProtoOAPayloadType" = betterproto.enum_field(1)
|
|
654
|
+
ctid_trader_account_id: int = betterproto.int64_field(2)
|
|
655
|
+
symbol_id: int = betterproto.int64_field(3)
|
|
656
|
+
bid: int = betterproto.uint64_field(4)
|
|
657
|
+
ask: int = betterproto.uint64_field(5)
|
|
658
|
+
trendbar: list["ProtoOATrendbar"] = betterproto.message_field(6)
|
|
659
|
+
session_close: int = betterproto.uint64_field(7)
|
|
660
|
+
timestamp: int = betterproto.int64_field(8)
|
|
661
|
+
|
|
662
|
+
|
|
663
|
+
@dataclass
|
|
664
|
+
class ProtoOASubscribeLiveTrendbarReq(betterproto.Message):
|
|
665
|
+
"""
|
|
666
|
+
* Request for subscribing for live trend bars. Requires subscription on the
|
|
667
|
+
spot events, see ProtoOASubscribeSpotsReq.
|
|
668
|
+
"""
|
|
669
|
+
|
|
670
|
+
payload_type: "ProtoOAPayloadType" = betterproto.enum_field(1)
|
|
671
|
+
ctid_trader_account_id: int = betterproto.int64_field(2)
|
|
672
|
+
period: "ProtoOATrendbarPeriod" = betterproto.enum_field(3)
|
|
673
|
+
symbol_id: int = betterproto.int64_field(4)
|
|
674
|
+
|
|
675
|
+
|
|
676
|
+
@dataclass
|
|
677
|
+
class ProtoOASubscribeLiveTrendbarRes(betterproto.Message):
|
|
678
|
+
"""* Response to the ProtoOASubscribeLiveTrendbarReq request."""
|
|
679
|
+
|
|
680
|
+
payload_type: "ProtoOAPayloadType" = betterproto.enum_field(1)
|
|
681
|
+
ctid_trader_account_id: int = betterproto.int64_field(2)
|
|
682
|
+
|
|
683
|
+
|
|
684
|
+
@dataclass
|
|
685
|
+
class ProtoOAUnsubscribeLiveTrendbarReq(betterproto.Message):
|
|
686
|
+
"""* Request for unsubscribing from the live trend bars."""
|
|
687
|
+
|
|
688
|
+
payload_type: "ProtoOAPayloadType" = betterproto.enum_field(1)
|
|
689
|
+
ctid_trader_account_id: int = betterproto.int64_field(2)
|
|
690
|
+
period: "ProtoOATrendbarPeriod" = betterproto.enum_field(3)
|
|
691
|
+
symbol_id: int = betterproto.int64_field(4)
|
|
692
|
+
|
|
693
|
+
|
|
694
|
+
@dataclass
|
|
695
|
+
class ProtoOAUnsubscribeLiveTrendbarRes(betterproto.Message):
|
|
696
|
+
"""* Response to the ProtoOASubscribeLiveTrendbarReq request."""
|
|
697
|
+
|
|
698
|
+
payload_type: "ProtoOAPayloadType" = betterproto.enum_field(1)
|
|
699
|
+
ctid_trader_account_id: int = betterproto.int64_field(2)
|
|
700
|
+
|
|
701
|
+
|
|
702
|
+
@dataclass
|
|
703
|
+
class ProtoOAGetTrendbarsReq(betterproto.Message):
|
|
704
|
+
"""* Request for getting historical trend bars for the symbol."""
|
|
705
|
+
|
|
706
|
+
payload_type: "ProtoOAPayloadType" = betterproto.enum_field(1)
|
|
707
|
+
ctid_trader_account_id: int = betterproto.int64_field(2)
|
|
708
|
+
from_timestamp: int = betterproto.int64_field(3)
|
|
709
|
+
to_timestamp: int = betterproto.int64_field(4)
|
|
710
|
+
period: "ProtoOATrendbarPeriod" = betterproto.enum_field(5)
|
|
711
|
+
symbol_id: int = betterproto.int64_field(6)
|
|
712
|
+
count: int = betterproto.uint32_field(7)
|
|
713
|
+
|
|
714
|
+
|
|
715
|
+
@dataclass
|
|
716
|
+
class ProtoOAGetTrendbarsRes(betterproto.Message):
|
|
717
|
+
"""* Response to the ProtoOAGetTrendbarsReq request."""
|
|
718
|
+
|
|
719
|
+
payload_type: "ProtoOAPayloadType" = betterproto.enum_field(1)
|
|
720
|
+
ctid_trader_account_id: int = betterproto.int64_field(2)
|
|
721
|
+
period: "ProtoOATrendbarPeriod" = betterproto.enum_field(3)
|
|
722
|
+
timestamp: int = betterproto.int64_field(4)
|
|
723
|
+
trendbar: list["ProtoOATrendbar"] = betterproto.message_field(5)
|
|
724
|
+
symbol_id: int = betterproto.int64_field(6)
|
|
725
|
+
has_more: bool = betterproto.bool_field(7)
|
|
726
|
+
|
|
727
|
+
|
|
728
|
+
@dataclass
|
|
729
|
+
class ProtoOAGetTickDataReq(betterproto.Message):
|
|
730
|
+
"""* Request for getting historical tick data for the symbol."""
|
|
731
|
+
|
|
732
|
+
payload_type: "ProtoOAPayloadType" = betterproto.enum_field(1)
|
|
733
|
+
ctid_trader_account_id: int = betterproto.int64_field(2)
|
|
734
|
+
symbol_id: int = betterproto.int64_field(3)
|
|
735
|
+
type: "ProtoOAQuoteType" = betterproto.enum_field(4)
|
|
736
|
+
from_timestamp: int = betterproto.int64_field(5)
|
|
737
|
+
to_timestamp: int = betterproto.int64_field(6)
|
|
738
|
+
|
|
739
|
+
|
|
740
|
+
@dataclass
|
|
741
|
+
class ProtoOAGetTickDataRes(betterproto.Message):
|
|
742
|
+
"""* Response to the ProtoOAGetTickDataReq request."""
|
|
743
|
+
|
|
744
|
+
payload_type: "ProtoOAPayloadType" = betterproto.enum_field(1)
|
|
745
|
+
ctid_trader_account_id: int = betterproto.int64_field(2)
|
|
746
|
+
tick_data: list["ProtoOATickData"] = betterproto.message_field(3)
|
|
747
|
+
has_more: bool = betterproto.bool_field(4)
|
|
748
|
+
|
|
749
|
+
|
|
750
|
+
@dataclass
|
|
751
|
+
class ProtoOAGetCtidProfileByTokenReq(betterproto.Message):
|
|
752
|
+
"""
|
|
753
|
+
* Request for getting details of Trader's profile. Limited due to GDRP
|
|
754
|
+
requirements.
|
|
755
|
+
"""
|
|
756
|
+
|
|
757
|
+
payload_type: "ProtoOAPayloadType" = betterproto.enum_field(1)
|
|
758
|
+
access_token: str = betterproto.string_field(2)
|
|
759
|
+
|
|
760
|
+
|
|
761
|
+
@dataclass
|
|
762
|
+
class ProtoOAGetCtidProfileByTokenRes(betterproto.Message):
|
|
763
|
+
"""* Response to the ProtoOAGetCtidProfileByTokenReq request."""
|
|
764
|
+
|
|
765
|
+
payload_type: "ProtoOAPayloadType" = betterproto.enum_field(1)
|
|
766
|
+
profile: "ProtoOACtidProfile" = betterproto.message_field(2)
|
|
767
|
+
|
|
768
|
+
|
|
769
|
+
@dataclass
|
|
770
|
+
class ProtoOADepthEvent(betterproto.Message):
|
|
771
|
+
"""
|
|
772
|
+
* Event that is sent when the structure of depth of market is changed.
|
|
773
|
+
Requires subscription on the depth of markets for the symbol, see
|
|
774
|
+
ProtoOASubscribeDepthQuotesReq.
|
|
775
|
+
"""
|
|
776
|
+
|
|
777
|
+
payload_type: "ProtoOAPayloadType" = betterproto.enum_field(1)
|
|
778
|
+
ctid_trader_account_id: int = betterproto.int64_field(2)
|
|
779
|
+
symbol_id: int = betterproto.uint64_field(3)
|
|
780
|
+
new_quotes: list["ProtoOADepthQuote"] = betterproto.message_field(4)
|
|
781
|
+
deleted_quotes: list[int] = betterproto.uint64_field(5)
|
|
782
|
+
|
|
783
|
+
|
|
784
|
+
@dataclass
|
|
785
|
+
class ProtoOASubscribeDepthQuotesReq(betterproto.Message):
|
|
786
|
+
"""
|
|
787
|
+
* Request for subscribing on depth of market of the specified symbol.
|
|
788
|
+
"""
|
|
789
|
+
|
|
790
|
+
payload_type: "ProtoOAPayloadType" = betterproto.enum_field(1)
|
|
791
|
+
ctid_trader_account_id: int = betterproto.int64_field(2)
|
|
792
|
+
symbol_id: list[int] = betterproto.int64_field(3)
|
|
793
|
+
|
|
794
|
+
|
|
795
|
+
@dataclass
|
|
796
|
+
class ProtoOASubscribeDepthQuotesRes(betterproto.Message):
|
|
797
|
+
"""* Response to the ProtoOASubscribeDepthQuotesReq request."""
|
|
798
|
+
|
|
799
|
+
payload_type: "ProtoOAPayloadType" = betterproto.enum_field(1)
|
|
800
|
+
ctid_trader_account_id: int = betterproto.int64_field(2)
|
|
801
|
+
|
|
802
|
+
|
|
803
|
+
@dataclass
|
|
804
|
+
class ProtoOAUnsubscribeDepthQuotesReq(betterproto.Message):
|
|
805
|
+
"""
|
|
806
|
+
* Request for unsubscribing from the depth of market of the specified
|
|
807
|
+
symbol.
|
|
808
|
+
"""
|
|
809
|
+
|
|
810
|
+
payload_type: "ProtoOAPayloadType" = betterproto.enum_field(1)
|
|
811
|
+
ctid_trader_account_id: int = betterproto.int64_field(2)
|
|
812
|
+
symbol_id: list[int] = betterproto.int64_field(3)
|
|
813
|
+
|
|
814
|
+
|
|
815
|
+
@dataclass
|
|
816
|
+
class ProtoOAUnsubscribeDepthQuotesRes(betterproto.Message):
|
|
817
|
+
"""* Response to the ProtoOAUnsubscribeDepthQuotesReq request."""
|
|
818
|
+
|
|
819
|
+
payload_type: "ProtoOAPayloadType" = betterproto.enum_field(1)
|
|
820
|
+
ctid_trader_account_id: int = betterproto.int64_field(2)
|
|
821
|
+
|
|
822
|
+
|
|
823
|
+
@dataclass
|
|
824
|
+
class ProtoOASymbolCategoryListReq(betterproto.Message):
|
|
825
|
+
"""
|
|
826
|
+
* Request for a list of symbol categories available for a trading account.
|
|
827
|
+
"""
|
|
828
|
+
|
|
829
|
+
payload_type: "ProtoOAPayloadType" = betterproto.enum_field(1)
|
|
830
|
+
ctid_trader_account_id: int = betterproto.int64_field(2)
|
|
831
|
+
|
|
832
|
+
|
|
833
|
+
@dataclass
|
|
834
|
+
class ProtoOASymbolCategoryListRes(betterproto.Message):
|
|
835
|
+
"""* Response to the ProtoSymbolCategoryListReq request."""
|
|
836
|
+
|
|
837
|
+
payload_type: "ProtoOAPayloadType" = betterproto.enum_field(1)
|
|
838
|
+
ctid_trader_account_id: int = betterproto.int64_field(2)
|
|
839
|
+
symbol_category: list["ProtoOASymbolCategory"] = betterproto.message_field(3)
|
|
840
|
+
|
|
841
|
+
|
|
842
|
+
@dataclass
|
|
843
|
+
class ProtoOAAccountLogoutReq(betterproto.Message):
|
|
844
|
+
"""* Request for logout of trading account session."""
|
|
845
|
+
|
|
846
|
+
payload_type: "ProtoOAPayloadType" = betterproto.enum_field(1)
|
|
847
|
+
ctid_trader_account_id: int = betterproto.int64_field(2)
|
|
848
|
+
|
|
849
|
+
|
|
850
|
+
@dataclass
|
|
851
|
+
class ProtoOAAccountLogoutRes(betterproto.Message):
|
|
852
|
+
"""
|
|
853
|
+
* Response to the ProtoOATraderLogoutReq request. Actual logout of trading
|
|
854
|
+
account will be completed on ProtoOAAccountDisconnectEvent.
|
|
855
|
+
"""
|
|
856
|
+
|
|
857
|
+
payload_type: "ProtoOAPayloadType" = betterproto.enum_field(1)
|
|
858
|
+
ctid_trader_account_id: int = betterproto.int64_field(2)
|
|
859
|
+
|
|
860
|
+
|
|
861
|
+
@dataclass
|
|
862
|
+
class ProtoOAAccountDisconnectEvent(betterproto.Message):
|
|
863
|
+
"""
|
|
864
|
+
* Event that is sent when the established session for an account is dropped
|
|
865
|
+
on the server side. A new session must be authorized for the account.
|
|
866
|
+
"""
|
|
867
|
+
|
|
868
|
+
payload_type: "ProtoOAPayloadType" = betterproto.enum_field(1)
|
|
869
|
+
ctid_trader_account_id: int = betterproto.int64_field(2)
|
|
870
|
+
|
|
871
|
+
|
|
872
|
+
@dataclass
|
|
873
|
+
class ProtoOAMarginCallListReq(betterproto.Message):
|
|
874
|
+
"""
|
|
875
|
+
* Request for a list of existing margin call thresholds configured for a
|
|
876
|
+
user.
|
|
877
|
+
"""
|
|
878
|
+
|
|
879
|
+
payload_type: "ProtoOAPayloadType" = betterproto.enum_field(1)
|
|
880
|
+
ctid_trader_account_id: int = betterproto.int64_field(2)
|
|
881
|
+
|
|
882
|
+
|
|
883
|
+
@dataclass
|
|
884
|
+
class ProtoOAMarginCallListRes(betterproto.Message):
|
|
885
|
+
"""
|
|
886
|
+
* Response with a list of existing user Margin Calls, usually contains 3
|
|
887
|
+
items.
|
|
888
|
+
"""
|
|
889
|
+
|
|
890
|
+
payload_type: "ProtoOAPayloadType" = betterproto.enum_field(1)
|
|
891
|
+
margin_call: list["ProtoOAMarginCall"] = betterproto.message_field(2)
|
|
892
|
+
|
|
893
|
+
|
|
894
|
+
@dataclass
|
|
895
|
+
class ProtoOAMarginCallUpdateReq(betterproto.Message):
|
|
896
|
+
"""
|
|
897
|
+
* Request to modify marginLevelThreshold of specified marginCallType for
|
|
898
|
+
ctidTraderAccountId.
|
|
899
|
+
"""
|
|
900
|
+
|
|
901
|
+
payload_type: "ProtoOAPayloadType" = betterproto.enum_field(1)
|
|
902
|
+
ctid_trader_account_id: int = betterproto.int64_field(2)
|
|
903
|
+
margin_call: "ProtoOAMarginCall" = betterproto.message_field(3)
|
|
904
|
+
|
|
905
|
+
|
|
906
|
+
@dataclass
|
|
907
|
+
class ProtoOAMarginCallUpdateRes(betterproto.Message):
|
|
908
|
+
"""
|
|
909
|
+
* If this response received, it means that margin call was successfully
|
|
910
|
+
updated.
|
|
911
|
+
"""
|
|
912
|
+
|
|
913
|
+
payload_type: "ProtoOAPayloadType" = betterproto.enum_field(1)
|
|
914
|
+
|
|
915
|
+
|
|
916
|
+
@dataclass
|
|
917
|
+
class ProtoOAMarginCallUpdateEvent(betterproto.Message):
|
|
918
|
+
"""
|
|
919
|
+
* Event that is sent when a Margin Call threshold configuration is updated.
|
|
920
|
+
"""
|
|
921
|
+
|
|
922
|
+
payload_type: "ProtoOAPayloadType" = betterproto.enum_field(1)
|
|
923
|
+
ctid_trader_account_id: int = betterproto.int64_field(2)
|
|
924
|
+
margin_call: "ProtoOAMarginCall" = betterproto.message_field(3)
|
|
925
|
+
|
|
926
|
+
|
|
927
|
+
@dataclass
|
|
928
|
+
class ProtoOAMarginCallTriggerEvent(betterproto.Message):
|
|
929
|
+
"""
|
|
930
|
+
* Event that is sent when account margin level reaches target
|
|
931
|
+
marginLevelThreshold. Event is sent no more than once every 10 minutes to
|
|
932
|
+
avoid spamming.
|
|
933
|
+
"""
|
|
934
|
+
|
|
935
|
+
payload_type: "ProtoOAPayloadType" = betterproto.enum_field(1)
|
|
936
|
+
ctid_trader_account_id: int = betterproto.int64_field(2)
|
|
937
|
+
margin_call: "ProtoOAMarginCall" = betterproto.message_field(3)
|
|
938
|
+
|
|
939
|
+
|
|
940
|
+
@dataclass
|
|
941
|
+
class ProtoOAGetDynamicLeverageByIDReq(betterproto.Message):
|
|
942
|
+
"""
|
|
943
|
+
* Request for getting a dynamic leverage entity referenced in
|
|
944
|
+
ProtoOASymbol.leverageId.
|
|
945
|
+
"""
|
|
946
|
+
|
|
947
|
+
payload_type: "ProtoOAPayloadType" = betterproto.enum_field(1)
|
|
948
|
+
ctid_trader_account_id: int = betterproto.int64_field(2)
|
|
949
|
+
leverage_id: int = betterproto.int64_field(3)
|
|
950
|
+
|
|
951
|
+
|
|
952
|
+
@dataclass
|
|
953
|
+
class ProtoOAGetDynamicLeverageByIDRes(betterproto.Message):
|
|
954
|
+
"""* Response to the ProtoOAGetDynamicLeverageByIDReq request."""
|
|
955
|
+
|
|
956
|
+
payload_type: "ProtoOAPayloadType" = betterproto.enum_field(1)
|
|
957
|
+
ctid_trader_account_id: int = betterproto.int64_field(2)
|
|
958
|
+
leverage: "ProtoOADynamicLeverage" = betterproto.message_field(3)
|
|
959
|
+
|
|
960
|
+
|
|
961
|
+
@dataclass
|
|
962
|
+
class ProtoOADealListByPositionIdReq(betterproto.Message):
|
|
963
|
+
"""* Request for retrieving the deals related to a position."""
|
|
964
|
+
|
|
965
|
+
payload_type: "ProtoOAPayloadType" = betterproto.enum_field(1)
|
|
966
|
+
ctid_trader_account_id: int = betterproto.int64_field(2)
|
|
967
|
+
position_id: int = betterproto.int64_field(3)
|
|
968
|
+
from_timestamp: int = betterproto.int64_field(4)
|
|
969
|
+
to_timestamp: int = betterproto.int64_field(5)
|
|
970
|
+
|
|
971
|
+
|
|
972
|
+
@dataclass
|
|
973
|
+
class ProtoOADealListByPositionIdRes(betterproto.Message):
|
|
974
|
+
"""* Response to the ProtoOADealListByPositionIdReq request."""
|
|
975
|
+
|
|
976
|
+
payload_type: "ProtoOAPayloadType" = betterproto.enum_field(1)
|
|
977
|
+
ctid_trader_account_id: int = betterproto.int64_field(2)
|
|
978
|
+
deal: list["ProtoOADeal"] = betterproto.message_field(3)
|
|
979
|
+
has_more: bool = betterproto.bool_field(4)
|
|
980
|
+
|
|
981
|
+
|
|
982
|
+
@dataclass
|
|
983
|
+
class ProtoOAOrderDetailsReq(betterproto.Message):
|
|
984
|
+
"""* Request for getting Order and its related Deals."""
|
|
985
|
+
|
|
986
|
+
payload_type: "ProtoOAPayloadType" = betterproto.enum_field(1)
|
|
987
|
+
ctid_trader_account_id: int = betterproto.int64_field(2)
|
|
988
|
+
order_id: int = betterproto.int64_field(3)
|
|
989
|
+
|
|
990
|
+
|
|
991
|
+
@dataclass
|
|
992
|
+
class ProtoOAOrderDetailsRes(betterproto.Message):
|
|
993
|
+
"""* Response to the ProtoOAOrderDetailsReq request."""
|
|
994
|
+
|
|
995
|
+
payload_type: "ProtoOAPayloadType" = betterproto.enum_field(1)
|
|
996
|
+
ctid_trader_account_id: int = betterproto.int64_field(2)
|
|
997
|
+
order: "ProtoOAOrder" = betterproto.message_field(3)
|
|
998
|
+
deal: list["ProtoOADeal"] = betterproto.message_field(4)
|
|
999
|
+
|
|
1000
|
+
|
|
1001
|
+
@dataclass
|
|
1002
|
+
class ProtoOAOrderListByPositionIdReq(betterproto.Message):
|
|
1003
|
+
"""
|
|
1004
|
+
* Request for retrieving Orders related to a Position by using Position ID.
|
|
1005
|
+
Filtered by utcLastUpdateTimestamp.
|
|
1006
|
+
"""
|
|
1007
|
+
|
|
1008
|
+
payload_type: "ProtoOAPayloadType" = betterproto.enum_field(1)
|
|
1009
|
+
ctid_trader_account_id: int = betterproto.int64_field(2)
|
|
1010
|
+
position_id: int = betterproto.int64_field(3)
|
|
1011
|
+
from_timestamp: int = betterproto.int64_field(4)
|
|
1012
|
+
to_timestamp: int = betterproto.int64_field(5)
|
|
1013
|
+
|
|
1014
|
+
|
|
1015
|
+
@dataclass
|
|
1016
|
+
class ProtoOAOrderListByPositionIdRes(betterproto.Message):
|
|
1017
|
+
"""* Response to ProtoOAOrderListByPositionIdReq request."""
|
|
1018
|
+
|
|
1019
|
+
payload_type: "ProtoOAPayloadType" = betterproto.enum_field(1)
|
|
1020
|
+
ctid_trader_account_id: int = betterproto.int64_field(2)
|
|
1021
|
+
order: list["ProtoOAOrder"] = betterproto.message_field(3)
|
|
1022
|
+
has_more: bool = betterproto.bool_field(4)
|
|
1023
|
+
|
|
1024
|
+
|
|
1025
|
+
@dataclass
|
|
1026
|
+
class ProtoOADealOffsetListReq(betterproto.Message):
|
|
1027
|
+
"""
|
|
1028
|
+
* Request for getting sets of Deals that were offset by a specific Deal and
|
|
1029
|
+
that are offsetting the Deal.
|
|
1030
|
+
"""
|
|
1031
|
+
|
|
1032
|
+
payload_type: "ProtoOAPayloadType" = betterproto.enum_field(1)
|
|
1033
|
+
ctid_trader_account_id: int = betterproto.int64_field(2)
|
|
1034
|
+
deal_id: int = betterproto.int64_field(3)
|
|
1035
|
+
|
|
1036
|
+
|
|
1037
|
+
@dataclass
|
|
1038
|
+
class ProtoOADealOffsetListRes(betterproto.Message):
|
|
1039
|
+
"""* Response for ProtoOADealOffsetListReq."""
|
|
1040
|
+
|
|
1041
|
+
payload_type: "ProtoOAPayloadType" = betterproto.enum_field(1)
|
|
1042
|
+
ctid_trader_account_id: int = betterproto.int64_field(2)
|
|
1043
|
+
offset_by: list["ProtoOADealOffset"] = betterproto.message_field(3)
|
|
1044
|
+
offsetting: list["ProtoOADealOffset"] = betterproto.message_field(4)
|
|
1045
|
+
|
|
1046
|
+
|
|
1047
|
+
@dataclass
|
|
1048
|
+
class ProtoOAGetPositionUnrealizedPnLReq(betterproto.Message):
|
|
1049
|
+
"""* Request for getting trader's positions' unrealized PnLs."""
|
|
1050
|
+
|
|
1051
|
+
payload_type: "ProtoOAPayloadType" = betterproto.enum_field(1)
|
|
1052
|
+
ctid_trader_account_id: int = betterproto.int64_field(2)
|
|
1053
|
+
|
|
1054
|
+
|
|
1055
|
+
@dataclass
|
|
1056
|
+
class ProtoOAGetPositionUnrealizedPnLRes(betterproto.Message):
|
|
1057
|
+
"""* Response to ProtoOAGetPositionUnrealizedPnLReq request."""
|
|
1058
|
+
|
|
1059
|
+
payload_type: "ProtoOAPayloadType" = betterproto.enum_field(1)
|
|
1060
|
+
ctid_trader_account_id: int = betterproto.int64_field(2)
|
|
1061
|
+
position_unrealized_pn_l: list["ProtoOAPositionUnrealizedPnL"] = betterproto.message_field(3)
|
|
1062
|
+
money_digits: int = betterproto.uint32_field(4)
|
|
1063
|
+
|
|
1064
|
+
|
|
1065
|
+
@dataclass
|
|
1066
|
+
class ProtoOAv1PnLChangeEvent(betterproto.Message):
|
|
1067
|
+
"""
|
|
1068
|
+
The event that is sent when the unrealized PnL is changed due to market
|
|
1069
|
+
movement. Requires subscribing to PnL events, see
|
|
1070
|
+
ProtoOAv1PnLChangeSubscribeReq
|
|
1071
|
+
"""
|
|
1072
|
+
|
|
1073
|
+
payload_type: "ProtoOAPayloadType" = betterproto.enum_field(1)
|
|
1074
|
+
ctid_trader_account_id: int = betterproto.int64_field(2)
|
|
1075
|
+
gross_unrealized_pn_l: int = betterproto.int64_field(3)
|
|
1076
|
+
net_unrealized_pn_l: int = betterproto.int64_field(4)
|
|
1077
|
+
money_digits: int = betterproto.uint32_field(5)
|
|
1078
|
+
|
|
1079
|
+
|
|
1080
|
+
@dataclass
|
|
1081
|
+
class ProtoOAv1PnLChangeSubscribeReq(betterproto.Message):
|
|
1082
|
+
"""The request to subscribe to ProtoOAv1PnLChangeEvent"""
|
|
1083
|
+
|
|
1084
|
+
payload_type: "ProtoOAPayloadType" = betterproto.enum_field(1)
|
|
1085
|
+
ctid_trader_account_id: int = betterproto.int64_field(2)
|
|
1086
|
+
|
|
1087
|
+
|
|
1088
|
+
@dataclass
|
|
1089
|
+
class ProtoOAv1PnLChangeSubscribeRes(betterproto.Message):
|
|
1090
|
+
"""The response for ProtoOAv1PnLChangeSubscribeReq"""
|
|
1091
|
+
|
|
1092
|
+
payload_type: "ProtoOAPayloadType" = betterproto.enum_field(1)
|
|
1093
|
+
ctid_trader_account_id: int = betterproto.int64_field(2)
|
|
1094
|
+
|
|
1095
|
+
|
|
1096
|
+
@dataclass
|
|
1097
|
+
class ProtoOAv1PnLChangeUnSubscribeReq(betterproto.Message):
|
|
1098
|
+
"""
|
|
1099
|
+
The request to stop an existing subscription to PnL events. The subscriber
|
|
1100
|
+
who sends this request will stop receiving ProtoOAv1PnLChangeEvent
|
|
1101
|
+
"""
|
|
1102
|
+
|
|
1103
|
+
payload_type: "ProtoOAPayloadType" = betterproto.enum_field(1)
|
|
1104
|
+
ctid_trader_account_id: int = betterproto.int64_field(2)
|
|
1105
|
+
|
|
1106
|
+
|
|
1107
|
+
@dataclass
|
|
1108
|
+
class ProtoOAv1PnLChangeUnSubscribeRes(betterproto.Message):
|
|
1109
|
+
"""The response for ProtoOAv1PnLChangeUnSubscribeReq"""
|
|
1110
|
+
|
|
1111
|
+
payload_type: "ProtoOAPayloadType" = betterproto.enum_field(1)
|
|
1112
|
+
ctid_trader_account_id: int = betterproto.int64_field(2)
|