hedgequantx 1.1.1
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.
- package/README.md +247 -0
- package/bin/cli.js +2096 -0
- package/package.json +52 -0
- package/src/api/projectx_gatewayapi.json +1766 -0
- package/src/api/projectx_userapi.json +641 -0
- package/src/config/constants.js +75 -0
- package/src/config/index.js +24 -0
- package/src/config/propfirms.js +56 -0
- package/src/pages/index.js +9 -0
- package/src/pages/stats.js +289 -0
- package/src/services/hqx-server.js +351 -0
- package/src/services/index.js +12 -0
- package/src/services/local-storage.js +309 -0
- package/src/services/projectx.js +369 -0
- package/src/services/session.js +143 -0
- package/src/ui/box.js +105 -0
- package/src/ui/device.js +85 -0
- package/src/ui/index.js +48 -0
- package/src/ui/table.js +81 -0
|
@@ -0,0 +1,641 @@
|
|
|
1
|
+
{
|
|
2
|
+
"x-generator": "NSwag v14.2.0.0 (NJsonSchema v11.1.0.0 (Newtonsoft.Json v13.0.0.0))",
|
|
3
|
+
"swagger": "2.0",
|
|
4
|
+
"info": {
|
|
5
|
+
"title": "ProjectX User API",
|
|
6
|
+
"description": "ProjectX User API Documentation and specification.",
|
|
7
|
+
"version": "1.0.0"
|
|
8
|
+
},
|
|
9
|
+
"host": "userapi.topstepx.com",
|
|
10
|
+
"schemes": [
|
|
11
|
+
"https"
|
|
12
|
+
],
|
|
13
|
+
"paths": {
|
|
14
|
+
"/AccountTemplate/userTemplates": {
|
|
15
|
+
"get": {
|
|
16
|
+
"tags": [
|
|
17
|
+
"AccountTemplate"
|
|
18
|
+
],
|
|
19
|
+
"summary": "Retrieves a list of all templates associated with a specific user",
|
|
20
|
+
"operationId": "AccountTemplate_GetUserTemplates",
|
|
21
|
+
"produces": [
|
|
22
|
+
"text/plain",
|
|
23
|
+
"application/json",
|
|
24
|
+
"text/json"
|
|
25
|
+
],
|
|
26
|
+
"responses": {
|
|
27
|
+
"200": {
|
|
28
|
+
"x-nullable": false,
|
|
29
|
+
"description": "A list of AccountTemplateModel.",
|
|
30
|
+
"schema": {
|
|
31
|
+
"type": "array",
|
|
32
|
+
"items": {
|
|
33
|
+
"$ref": "#/definitions/AccountTemplateModel"
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
"/AccountTemplateRule/rules/{accountTemplateId}/all": {
|
|
41
|
+
"get": {
|
|
42
|
+
"tags": [
|
|
43
|
+
"AccountTemplateRule"
|
|
44
|
+
],
|
|
45
|
+
"summary": "Retrieves a list of all rule configurations for the specified account template id",
|
|
46
|
+
"operationId": "AccountTemplateRule_GetAllAttachedRules",
|
|
47
|
+
"produces": [
|
|
48
|
+
"text/plain",
|
|
49
|
+
"application/json",
|
|
50
|
+
"text/json"
|
|
51
|
+
],
|
|
52
|
+
"parameters": [
|
|
53
|
+
{
|
|
54
|
+
"type": "integer",
|
|
55
|
+
"name": "accountTemplateId",
|
|
56
|
+
"in": "path",
|
|
57
|
+
"required": true,
|
|
58
|
+
"description": "Account template id",
|
|
59
|
+
"format": "int32",
|
|
60
|
+
"x-nullable": false
|
|
61
|
+
}
|
|
62
|
+
],
|
|
63
|
+
"responses": {
|
|
64
|
+
"200": {
|
|
65
|
+
"x-nullable": false,
|
|
66
|
+
"description": "List of rule types (rule IDs) attached to the template",
|
|
67
|
+
"schema": {
|
|
68
|
+
"type": "array",
|
|
69
|
+
"items": {
|
|
70
|
+
"$ref": "#/definitions/AccountTemplateRuleModel"
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
"/brackets": {
|
|
78
|
+
"get": {
|
|
79
|
+
"tags": [
|
|
80
|
+
"AutoOcoBrackets"
|
|
81
|
+
],
|
|
82
|
+
"operationId": "AutoOcoBrackets_Get",
|
|
83
|
+
"produces": [
|
|
84
|
+
"text/plain",
|
|
85
|
+
"application/json",
|
|
86
|
+
"text/json"
|
|
87
|
+
],
|
|
88
|
+
"responses": {
|
|
89
|
+
"200": {
|
|
90
|
+
"x-nullable": false,
|
|
91
|
+
"description": "",
|
|
92
|
+
"schema": {
|
|
93
|
+
"type": "array",
|
|
94
|
+
"items": {
|
|
95
|
+
"$ref": "#/definitions/AutoOcoBracketModel"
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
},
|
|
101
|
+
"post": {
|
|
102
|
+
"tags": [
|
|
103
|
+
"AutoOcoBrackets"
|
|
104
|
+
],
|
|
105
|
+
"operationId": "AutoOcoBrackets_Post",
|
|
106
|
+
"consumes": [
|
|
107
|
+
"application/json",
|
|
108
|
+
"text/json",
|
|
109
|
+
"application/*+json"
|
|
110
|
+
],
|
|
111
|
+
"produces": [
|
|
112
|
+
"text/plain",
|
|
113
|
+
"application/json",
|
|
114
|
+
"text/json"
|
|
115
|
+
],
|
|
116
|
+
"parameters": [
|
|
117
|
+
{
|
|
118
|
+
"name": "request",
|
|
119
|
+
"in": "body",
|
|
120
|
+
"required": true,
|
|
121
|
+
"schema": {
|
|
122
|
+
"$ref": "#/definitions/AutoOcoBracketRequest"
|
|
123
|
+
},
|
|
124
|
+
"x-nullable": false
|
|
125
|
+
}
|
|
126
|
+
],
|
|
127
|
+
"responses": {
|
|
128
|
+
"200": {
|
|
129
|
+
"x-nullable": false,
|
|
130
|
+
"description": "",
|
|
131
|
+
"schema": {
|
|
132
|
+
"$ref": "#/definitions/AutoOcoBracketResponse"
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
},
|
|
137
|
+
"delete": {
|
|
138
|
+
"tags": [
|
|
139
|
+
"AutoOcoBrackets"
|
|
140
|
+
],
|
|
141
|
+
"operationId": "AutoOcoBrackets_Delete",
|
|
142
|
+
"consumes": [
|
|
143
|
+
"application/json",
|
|
144
|
+
"text/json",
|
|
145
|
+
"application/*+json"
|
|
146
|
+
],
|
|
147
|
+
"produces": [
|
|
148
|
+
"text/plain",
|
|
149
|
+
"application/json",
|
|
150
|
+
"text/json"
|
|
151
|
+
],
|
|
152
|
+
"parameters": [
|
|
153
|
+
{
|
|
154
|
+
"name": "request",
|
|
155
|
+
"in": "body",
|
|
156
|
+
"required": true,
|
|
157
|
+
"schema": {
|
|
158
|
+
"$ref": "#/definitions/AutoOcoBracketRemoveRequest"
|
|
159
|
+
},
|
|
160
|
+
"x-nullable": false
|
|
161
|
+
}
|
|
162
|
+
],
|
|
163
|
+
"responses": {
|
|
164
|
+
"200": {
|
|
165
|
+
"x-nullable": false,
|
|
166
|
+
"description": "",
|
|
167
|
+
"schema": {
|
|
168
|
+
"$ref": "#/definitions/AutoOcoBracketRemoveResponse"
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
},
|
|
174
|
+
"/Login": {
|
|
175
|
+
"post": {
|
|
176
|
+
"tags": [
|
|
177
|
+
"Login"
|
|
178
|
+
],
|
|
179
|
+
"summary": "Authenticates a user based on the provided login request.",
|
|
180
|
+
"operationId": "Login_Login",
|
|
181
|
+
"consumes": [
|
|
182
|
+
"application/json",
|
|
183
|
+
"text/json",
|
|
184
|
+
"application/*+json"
|
|
185
|
+
],
|
|
186
|
+
"produces": [
|
|
187
|
+
"text/plain",
|
|
188
|
+
"application/json",
|
|
189
|
+
"text/json"
|
|
190
|
+
],
|
|
191
|
+
"parameters": [
|
|
192
|
+
{
|
|
193
|
+
"name": "model",
|
|
194
|
+
"in": "body",
|
|
195
|
+
"required": true,
|
|
196
|
+
"description": "A login request model containing the username and password of the user.",
|
|
197
|
+
"schema": {
|
|
198
|
+
"$ref": "#/definitions/LoginRequestModel"
|
|
199
|
+
},
|
|
200
|
+
"x-nullable": false
|
|
201
|
+
}
|
|
202
|
+
],
|
|
203
|
+
"responses": {
|
|
204
|
+
"200": {
|
|
205
|
+
"x-nullable": false,
|
|
206
|
+
"description": "A model containing the result of the login attempt and the token, if successful.",
|
|
207
|
+
"schema": {
|
|
208
|
+
"$ref": "#/definitions/LoginResultModel"
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
},
|
|
214
|
+
"/Login/key": {
|
|
215
|
+
"post": {
|
|
216
|
+
"tags": [
|
|
217
|
+
"Login"
|
|
218
|
+
],
|
|
219
|
+
"operationId": "Login_ApiLogin",
|
|
220
|
+
"consumes": [
|
|
221
|
+
"application/json",
|
|
222
|
+
"text/json",
|
|
223
|
+
"application/*+json"
|
|
224
|
+
],
|
|
225
|
+
"produces": [
|
|
226
|
+
"text/plain",
|
|
227
|
+
"application/json",
|
|
228
|
+
"text/json"
|
|
229
|
+
],
|
|
230
|
+
"parameters": [
|
|
231
|
+
{
|
|
232
|
+
"name": "request",
|
|
233
|
+
"in": "body",
|
|
234
|
+
"required": true,
|
|
235
|
+
"schema": {
|
|
236
|
+
"$ref": "#/definitions/ApiKeyLoginRequest"
|
|
237
|
+
},
|
|
238
|
+
"x-nullable": false
|
|
239
|
+
}
|
|
240
|
+
],
|
|
241
|
+
"responses": {
|
|
242
|
+
"200": {
|
|
243
|
+
"x-nullable": false,
|
|
244
|
+
"description": "",
|
|
245
|
+
"schema": {
|
|
246
|
+
"$ref": "#/definitions/LoginResultModel"
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
},
|
|
252
|
+
"/Order": {
|
|
253
|
+
"get": {
|
|
254
|
+
"tags": [
|
|
255
|
+
"Order"
|
|
256
|
+
],
|
|
257
|
+
"summary": "Retrieves a list of recent orders for an account.",
|
|
258
|
+
"operationId": "Order_Get",
|
|
259
|
+
"produces": [
|
|
260
|
+
"text/plain",
|
|
261
|
+
"application/json",
|
|
262
|
+
"text/json"
|
|
263
|
+
],
|
|
264
|
+
"parameters": [
|
|
265
|
+
{
|
|
266
|
+
"type": "integer",
|
|
267
|
+
"name": "accountId",
|
|
268
|
+
"in": "query",
|
|
269
|
+
"description": "The ID of the account.",
|
|
270
|
+
"format": "int32",
|
|
271
|
+
"x-nullable": false
|
|
272
|
+
}
|
|
273
|
+
],
|
|
274
|
+
"responses": {
|
|
275
|
+
"200": {
|
|
276
|
+
"x-nullable": false,
|
|
277
|
+
"description": "A list of recent orders for the specified account.",
|
|
278
|
+
"schema": {
|
|
279
|
+
"type": "array",
|
|
280
|
+
"items": {
|
|
281
|
+
"$ref": "#/definitions/OrderModel"
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
},
|
|
287
|
+
"post": {
|
|
288
|
+
"tags": [
|
|
289
|
+
"Order"
|
|
290
|
+
],
|
|
291
|
+
"summary": "Places an order.",
|
|
292
|
+
"operationId": "Order_Post",
|
|
293
|
+
"consumes": [
|
|
294
|
+
"application/json",
|
|
295
|
+
"text/json",
|
|
296
|
+
"application/*+json"
|
|
297
|
+
],
|
|
298
|
+
"produces": [
|
|
299
|
+
"text/plain",
|
|
300
|
+
"application/json",
|
|
301
|
+
"text/json"
|
|
302
|
+
],
|
|
303
|
+
"parameters": [
|
|
304
|
+
{
|
|
305
|
+
"name": "request",
|
|
306
|
+
"in": "body",
|
|
307
|
+
"required": true,
|
|
308
|
+
"description": "The request containing the details of the order to be placed.",
|
|
309
|
+
"schema": {
|
|
310
|
+
"$ref": "#/definitions/PlaceOrderRequest"
|
|
311
|
+
},
|
|
312
|
+
"x-nullable": false
|
|
313
|
+
}
|
|
314
|
+
],
|
|
315
|
+
"responses": {
|
|
316
|
+
"200": {
|
|
317
|
+
"x-nullable": false,
|
|
318
|
+
"description": "A response containing the result of the order placement operation.",
|
|
319
|
+
"schema": {
|
|
320
|
+
"$ref": "#/definitions/PlaceOrderResponse"
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
},
|
|
326
|
+
"/Position": {
|
|
327
|
+
"get": {
|
|
328
|
+
"tags": [
|
|
329
|
+
"Position"
|
|
330
|
+
],
|
|
331
|
+
"summary": "Retrieves the open positions for an account.",
|
|
332
|
+
"operationId": "Position_Get",
|
|
333
|
+
"produces": [
|
|
334
|
+
"text/plain",
|
|
335
|
+
"application/json",
|
|
336
|
+
"text/json"
|
|
337
|
+
],
|
|
338
|
+
"parameters": [
|
|
339
|
+
{
|
|
340
|
+
"type": "integer",
|
|
341
|
+
"name": "accountId",
|
|
342
|
+
"in": "query",
|
|
343
|
+
"description": "The ID of the account.",
|
|
344
|
+
"format": "int32",
|
|
345
|
+
"x-nullable": false
|
|
346
|
+
}
|
|
347
|
+
],
|
|
348
|
+
"responses": {
|
|
349
|
+
"200": {
|
|
350
|
+
"x-nullable": false,
|
|
351
|
+
"description": "A list of PositionModel representing the open positions for the account.",
|
|
352
|
+
"schema": {
|
|
353
|
+
"type": "array",
|
|
354
|
+
"items": {
|
|
355
|
+
"$ref": "#/definitions/PositionModel"
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
},
|
|
362
|
+
"/TradingAccount": {
|
|
363
|
+
"get": {
|
|
364
|
+
"tags": [
|
|
365
|
+
"TradingAccount"
|
|
366
|
+
],
|
|
367
|
+
"summary": "Retrieves all accounts associated with the current user.",
|
|
368
|
+
"operationId": "TradingAccount_Get",
|
|
369
|
+
"produces": [
|
|
370
|
+
"text/plain",
|
|
371
|
+
"application/json",
|
|
372
|
+
"text/json"
|
|
373
|
+
],
|
|
374
|
+
"responses": {
|
|
375
|
+
"200": {
|
|
376
|
+
"x-nullable": false,
|
|
377
|
+
"description": "A list of TradingAccountModel representing the accounts of the current user.",
|
|
378
|
+
"schema": {
|
|
379
|
+
"type": "array",
|
|
380
|
+
"items": {
|
|
381
|
+
"$ref": "#/definitions/TradingAccountModel"
|
|
382
|
+
}
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
},
|
|
388
|
+
"/User": {
|
|
389
|
+
"get": {
|
|
390
|
+
"tags": [
|
|
391
|
+
"User"
|
|
392
|
+
],
|
|
393
|
+
"summary": "Retrieves details about the current user.",
|
|
394
|
+
"operationId": "User_Get",
|
|
395
|
+
"produces": [
|
|
396
|
+
"text/plain",
|
|
397
|
+
"application/json",
|
|
398
|
+
"text/json"
|
|
399
|
+
],
|
|
400
|
+
"responses": {
|
|
401
|
+
"200": {
|
|
402
|
+
"x-nullable": false,
|
|
403
|
+
"description": "A UserModel containing the user's details.",
|
|
404
|
+
"schema": {
|
|
405
|
+
"$ref": "#/definitions/UserModel"
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
},
|
|
412
|
+
"definitions": {
|
|
413
|
+
"AccountTemplateModel": {
|
|
414
|
+
"type": "object",
|
|
415
|
+
"required": [
|
|
416
|
+
"id",
|
|
417
|
+
"title",
|
|
418
|
+
"startingBalance",
|
|
419
|
+
"margin",
|
|
420
|
+
"tag",
|
|
421
|
+
"limitCopyTradingToTemplate"
|
|
422
|
+
],
|
|
423
|
+
"properties": {
|
|
424
|
+
"id": {
|
|
425
|
+
"type": "integer",
|
|
426
|
+
"format": "int32"
|
|
427
|
+
},
|
|
428
|
+
"title": {
|
|
429
|
+
"type": "string"
|
|
430
|
+
},
|
|
431
|
+
"startingBalance": {
|
|
432
|
+
"type": "number",
|
|
433
|
+
"format": "decimal"
|
|
434
|
+
},
|
|
435
|
+
"margin": {
|
|
436
|
+
"type": "number",
|
|
437
|
+
"format": "decimal"
|
|
438
|
+
},
|
|
439
|
+
"tag": {
|
|
440
|
+
"type": "integer"
|
|
441
|
+
},
|
|
442
|
+
"limitCopyTradingToTemplate": {
|
|
443
|
+
"type": "boolean"
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
},
|
|
447
|
+
"LoginRequestModel": {
|
|
448
|
+
"type": "object",
|
|
449
|
+
"required": [
|
|
450
|
+
"userName",
|
|
451
|
+
"password"
|
|
452
|
+
],
|
|
453
|
+
"properties": {
|
|
454
|
+
"userName": {
|
|
455
|
+
"type": "string"
|
|
456
|
+
},
|
|
457
|
+
"password": {
|
|
458
|
+
"type": "string"
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
},
|
|
462
|
+
"LoginResultModel": {
|
|
463
|
+
"type": "object",
|
|
464
|
+
"required": [
|
|
465
|
+
"result"
|
|
466
|
+
],
|
|
467
|
+
"properties": {
|
|
468
|
+
"result": {
|
|
469
|
+
"type": "integer"
|
|
470
|
+
},
|
|
471
|
+
"token": {
|
|
472
|
+
"type": "string"
|
|
473
|
+
}
|
|
474
|
+
}
|
|
475
|
+
},
|
|
476
|
+
"ApiKeyLoginRequest": {
|
|
477
|
+
"type": "object",
|
|
478
|
+
"required": [
|
|
479
|
+
"userName",
|
|
480
|
+
"apiKey"
|
|
481
|
+
],
|
|
482
|
+
"properties": {
|
|
483
|
+
"userName": {
|
|
484
|
+
"type": "string"
|
|
485
|
+
},
|
|
486
|
+
"apiKey": {
|
|
487
|
+
"type": "string"
|
|
488
|
+
}
|
|
489
|
+
}
|
|
490
|
+
},
|
|
491
|
+
"OrderModel": {
|
|
492
|
+
"type": "object",
|
|
493
|
+
"properties": {
|
|
494
|
+
"id": {
|
|
495
|
+
"type": "integer",
|
|
496
|
+
"format": "int64"
|
|
497
|
+
},
|
|
498
|
+
"symbolId": {
|
|
499
|
+
"type": "string"
|
|
500
|
+
},
|
|
501
|
+
"accountId": {
|
|
502
|
+
"type": "integer",
|
|
503
|
+
"format": "int32"
|
|
504
|
+
},
|
|
505
|
+
"status": {
|
|
506
|
+
"type": "integer"
|
|
507
|
+
},
|
|
508
|
+
"type": {
|
|
509
|
+
"type": "integer"
|
|
510
|
+
},
|
|
511
|
+
"positionSize": {
|
|
512
|
+
"type": "integer",
|
|
513
|
+
"format": "int32"
|
|
514
|
+
}
|
|
515
|
+
}
|
|
516
|
+
},
|
|
517
|
+
"PlaceOrderRequest": {
|
|
518
|
+
"type": "object",
|
|
519
|
+
"required": [
|
|
520
|
+
"accountId",
|
|
521
|
+
"symbolId",
|
|
522
|
+
"type",
|
|
523
|
+
"positionSize",
|
|
524
|
+
"timeType"
|
|
525
|
+
],
|
|
526
|
+
"properties": {
|
|
527
|
+
"accountId": {
|
|
528
|
+
"type": "integer",
|
|
529
|
+
"format": "int32"
|
|
530
|
+
},
|
|
531
|
+
"symbolId": {
|
|
532
|
+
"type": "string"
|
|
533
|
+
},
|
|
534
|
+
"type": {
|
|
535
|
+
"type": "integer"
|
|
536
|
+
},
|
|
537
|
+
"limitPrice": {
|
|
538
|
+
"type": "number",
|
|
539
|
+
"format": "decimal"
|
|
540
|
+
},
|
|
541
|
+
"stopPrice": {
|
|
542
|
+
"type": "number",
|
|
543
|
+
"format": "decimal"
|
|
544
|
+
},
|
|
545
|
+
"positionSize": {
|
|
546
|
+
"type": "integer",
|
|
547
|
+
"format": "int32"
|
|
548
|
+
},
|
|
549
|
+
"timeType": {
|
|
550
|
+
"type": "integer"
|
|
551
|
+
}
|
|
552
|
+
}
|
|
553
|
+
},
|
|
554
|
+
"PlaceOrderResponse": {
|
|
555
|
+
"type": "object",
|
|
556
|
+
"properties": {
|
|
557
|
+
"result": {
|
|
558
|
+
"type": "integer"
|
|
559
|
+
},
|
|
560
|
+
"orderId": {
|
|
561
|
+
"type": "integer",
|
|
562
|
+
"format": "int64"
|
|
563
|
+
},
|
|
564
|
+
"errorMessage": {
|
|
565
|
+
"type": "string"
|
|
566
|
+
}
|
|
567
|
+
}
|
|
568
|
+
},
|
|
569
|
+
"PositionModel": {
|
|
570
|
+
"type": "object",
|
|
571
|
+
"properties": {
|
|
572
|
+
"id": {
|
|
573
|
+
"type": "integer",
|
|
574
|
+
"format": "int32"
|
|
575
|
+
},
|
|
576
|
+
"symbolId": {
|
|
577
|
+
"type": "string"
|
|
578
|
+
},
|
|
579
|
+
"positionSize": {
|
|
580
|
+
"type": "integer",
|
|
581
|
+
"format": "int32"
|
|
582
|
+
},
|
|
583
|
+
"averagePrice": {
|
|
584
|
+
"type": "number",
|
|
585
|
+
"format": "decimal"
|
|
586
|
+
},
|
|
587
|
+
"profitAndLoss": {
|
|
588
|
+
"type": "number",
|
|
589
|
+
"format": "decimal"
|
|
590
|
+
},
|
|
591
|
+
"accountId": {
|
|
592
|
+
"type": "integer",
|
|
593
|
+
"format": "int32"
|
|
594
|
+
}
|
|
595
|
+
}
|
|
596
|
+
},
|
|
597
|
+
"TradingAccountModel": {
|
|
598
|
+
"type": "object",
|
|
599
|
+
"properties": {
|
|
600
|
+
"accountId": {
|
|
601
|
+
"type": "integer",
|
|
602
|
+
"format": "int32"
|
|
603
|
+
},
|
|
604
|
+
"accountName": {
|
|
605
|
+
"type": "string"
|
|
606
|
+
},
|
|
607
|
+
"balance": {
|
|
608
|
+
"type": "number",
|
|
609
|
+
"format": "decimal"
|
|
610
|
+
},
|
|
611
|
+
"status": {
|
|
612
|
+
"type": "integer"
|
|
613
|
+
},
|
|
614
|
+
"type": {
|
|
615
|
+
"type": "integer"
|
|
616
|
+
}
|
|
617
|
+
}
|
|
618
|
+
},
|
|
619
|
+
"UserModel": {
|
|
620
|
+
"type": "object",
|
|
621
|
+
"properties": {
|
|
622
|
+
"userName": {
|
|
623
|
+
"type": "string"
|
|
624
|
+
},
|
|
625
|
+
"email": {
|
|
626
|
+
"type": "string"
|
|
627
|
+
},
|
|
628
|
+
"userId": {
|
|
629
|
+
"type": "integer",
|
|
630
|
+
"format": "int32"
|
|
631
|
+
},
|
|
632
|
+
"firstName": {
|
|
633
|
+
"type": "string"
|
|
634
|
+
},
|
|
635
|
+
"lastName": {
|
|
636
|
+
"type": "string"
|
|
637
|
+
}
|
|
638
|
+
}
|
|
639
|
+
}
|
|
640
|
+
}
|
|
641
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Application Constants
|
|
3
|
+
*/
|
|
4
|
+
|
|
5
|
+
// Account Status Codes (ProjectX UserAPI)
|
|
6
|
+
const ACCOUNT_STATUS = {
|
|
7
|
+
0: { text: 'Active', color: 'green' },
|
|
8
|
+
1: { text: 'End Of Day', color: 'cyan' },
|
|
9
|
+
2: { text: 'Halted', color: 'red' },
|
|
10
|
+
3: { text: 'Paused', color: 'yellow' },
|
|
11
|
+
4: { text: 'Holiday', color: 'blue' },
|
|
12
|
+
5: { text: 'Expired', color: 'gray' },
|
|
13
|
+
6: { text: 'Terminated', color: 'red' },
|
|
14
|
+
7: { text: 'Cancelled', color: 'red' },
|
|
15
|
+
8: { text: 'Failed', color: 'red' },
|
|
16
|
+
9: { text: 'Passed', color: 'green' }
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
// Account Types (ProjectX UserAPI)
|
|
20
|
+
const ACCOUNT_TYPE = {
|
|
21
|
+
0: { text: 'Practice', color: 'blue' },
|
|
22
|
+
1: { text: 'Evaluation', color: 'yellow' },
|
|
23
|
+
2: { text: 'Live', color: 'green' },
|
|
24
|
+
3: { text: 'Express', color: 'magenta' },
|
|
25
|
+
4: { text: 'Sim', color: 'gray' }
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
// Order Status
|
|
29
|
+
const ORDER_STATUS = {
|
|
30
|
+
0: { text: 'Pending', color: 'yellow', icon: '[~]' },
|
|
31
|
+
1: { text: 'Working', color: 'cyan', icon: '[>]' },
|
|
32
|
+
2: { text: 'Filled', color: 'green', icon: '[OK]' },
|
|
33
|
+
3: { text: 'Cancelled', color: 'gray', icon: '[X]' },
|
|
34
|
+
4: { text: 'Rejected', color: 'red', icon: '[!]' },
|
|
35
|
+
5: { text: 'Expired', color: 'gray', icon: '[-]' }
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
// Order Types
|
|
39
|
+
const ORDER_TYPE = {
|
|
40
|
+
1: 'Market',
|
|
41
|
+
2: 'Limit',
|
|
42
|
+
3: 'Stop',
|
|
43
|
+
4: 'Stop Limit'
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
// Order Side
|
|
47
|
+
const ORDER_SIDE = {
|
|
48
|
+
0: { text: 'Buy', color: 'green' },
|
|
49
|
+
1: { text: 'Sell', color: 'red' }
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
// Popular Futures Symbols
|
|
53
|
+
const FUTURES_SYMBOLS = [
|
|
54
|
+
{ name: 'NQ - E-mini NASDAQ-100', value: 'NQ', searchText: 'NQ' },
|
|
55
|
+
{ name: 'MNQ - Micro E-mini NASDAQ-100', value: 'MNQ', searchText: 'MNQ' },
|
|
56
|
+
{ name: 'ES - E-mini S&P 500', value: 'ES', searchText: 'ES' },
|
|
57
|
+
{ name: 'MES - Micro E-mini S&P 500', value: 'MES', searchText: 'MES' },
|
|
58
|
+
{ name: 'YM - E-mini Dow Jones', value: 'YM', searchText: 'YM' },
|
|
59
|
+
{ name: 'MYM - Micro E-mini Dow Jones', value: 'MYM', searchText: 'MYM' },
|
|
60
|
+
{ name: 'RTY - E-mini Russell 2000', value: 'RTY', searchText: 'RTY' },
|
|
61
|
+
{ name: 'M2K - Micro E-mini Russell 2000', value: 'M2K', searchText: 'M2K' },
|
|
62
|
+
{ name: 'CL - Crude Oil', value: 'CL', searchText: 'CL' },
|
|
63
|
+
{ name: 'MCL - Micro Crude Oil', value: 'MCL', searchText: 'MCL' },
|
|
64
|
+
{ name: 'GC - Gold', value: 'GC', searchText: 'GC' },
|
|
65
|
+
{ name: 'MGC - Micro Gold', value: 'MGC', searchText: 'MGC' }
|
|
66
|
+
];
|
|
67
|
+
|
|
68
|
+
module.exports = {
|
|
69
|
+
ACCOUNT_STATUS,
|
|
70
|
+
ACCOUNT_TYPE,
|
|
71
|
+
ORDER_STATUS,
|
|
72
|
+
ORDER_TYPE,
|
|
73
|
+
ORDER_SIDE,
|
|
74
|
+
FUTURES_SYMBOLS
|
|
75
|
+
};
|