-
Notifications
You must be signed in to change notification settings - Fork 2
/
order_service.go
707 lines (623 loc) · 20.7 KB
/
order_service.go
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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
package binance
import (
"context"
"encoding/json"
"github.com/crypto-zero/go-binance/v2/common"
)
// CreateOrderService create order
type CreateOrderService struct {
c *Client
symbol string
side SideType
orderType OrderType
timeInForce *TimeInForceType
newOrderRespType *NewOrderRespType
quantity *string
quoteOrderQty *string
price *string
newClientOrderID *string
stopPrice *string
icebergQuantity *string
}
// Symbol set symbol
func (s *CreateOrderService) Symbol(symbol string) *CreateOrderService {
s.symbol = symbol
return s
}
// Side set side
func (s *CreateOrderService) Side(side SideType) *CreateOrderService {
s.side = side
return s
}
// Type set type
func (s *CreateOrderService) Type(orderType OrderType) *CreateOrderService {
s.orderType = orderType
return s
}
// TimeInForce set timeInForce
func (s *CreateOrderService) TimeInForce(timeInForce TimeInForceType) *CreateOrderService {
s.timeInForce = &timeInForce
return s
}
// Quantity set quantity
func (s *CreateOrderService) Quantity(quantity string) *CreateOrderService {
s.quantity = &quantity
return s
}
// QuoteOrderQty set quoteOrderQty
func (s *CreateOrderService) QuoteOrderQty(quoteOrderQty string) *CreateOrderService {
s.quoteOrderQty = "eOrderQty
return s
}
// Price set price
func (s *CreateOrderService) Price(price string) *CreateOrderService {
s.price = &price
return s
}
// NewClientOrderID set newClientOrderID
func (s *CreateOrderService) NewClientOrderID(newClientOrderID string) *CreateOrderService {
s.newClientOrderID = &newClientOrderID
return s
}
// StopPrice set stopPrice
func (s *CreateOrderService) StopPrice(stopPrice string) *CreateOrderService {
s.stopPrice = &stopPrice
return s
}
// IcebergQuantity set icebergQuantity
func (s *CreateOrderService) IcebergQuantity(icebergQuantity string) *CreateOrderService {
s.icebergQuantity = &icebergQuantity
return s
}
// NewOrderRespType set icebergQuantity
func (s *CreateOrderService) NewOrderRespType(newOrderRespType NewOrderRespType) *CreateOrderService {
s.newOrderRespType = &newOrderRespType
return s
}
func (s *CreateOrderService) createOrder(ctx context.Context, endpoint string, result interface{},
opts ...common.RequestOption,
) (err error) {
r := common.NewPostRequestSigned(endpoint)
m := common.Params{
"symbol": s.symbol,
"side": s.side,
"type": s.orderType,
}
if s.quantity != nil {
m["quantity"] = *s.quantity
}
if s.quoteOrderQty != nil {
m["quoteOrderQty"] = *s.quoteOrderQty
}
if s.timeInForce != nil {
m["timeInForce"] = *s.timeInForce
}
if s.price != nil {
m["price"] = *s.price
}
if s.newClientOrderID != nil {
m["newClientOrderId"] = *s.newClientOrderID
}
if s.stopPrice != nil {
m["stopPrice"] = *s.stopPrice
}
if s.icebergQuantity != nil {
m["icebergQty"] = *s.icebergQuantity
}
if s.newOrderRespType != nil {
m["newOrderRespType"] = *s.newOrderRespType
}
r.SetFormParams(m)
if err = s.c.CallAPI(ctx, r, result, opts...); err != nil {
return err
}
return nil
}
// Do send Request
func (s *CreateOrderService) Do(ctx context.Context, opts ...common.RequestOption) (res *CreateOrderResponse, err error) {
res = new(CreateOrderResponse)
if err = s.createOrder(ctx, "/api/v3/order", res, opts...); err != nil {
return nil, err
}
return res, nil
}
// Test send test api to check if the Request is valid
func (s *CreateOrderService) Test(ctx context.Context, opts ...common.RequestOption) (err error) {
return s.createOrder(ctx, "/api/v3/order/test", nil, opts...)
}
// CreateOrderResponse define create order response
type CreateOrderResponse struct {
Symbol string `json:"symbol"`
OrderID int64 `json:"orderId"`
ClientOrderID string `json:"clientOrderId"`
TransactTime int64 `json:"transactTime"`
Price string `json:"price"`
OrigQuantity string `json:"origQty"`
ExecutedQuantity string `json:"executedQty"`
CummulativeQuoteQuantity string `json:"cummulativeQuoteQty"`
IsIsolated bool `json:"isIsolated"` // for isolated margin
Status OrderStatusType `json:"status"`
TimeInForce TimeInForceType `json:"timeInForce"`
Type OrderType `json:"type"`
Side SideType `json:"side"`
// for order response is set to FULL
Fills []*Fill `json:"fills"`
MarginBuyBorrowAmount string `json:"marginBuyBorrowAmount"` // for margin
MarginBuyBorrowAsset string `json:"marginBuyBorrowAsset"`
}
// Fill may be returned in an array of fills in a CreateOrderResponse.
type Fill struct {
Price string `json:"price"`
Quantity string `json:"qty"`
Commission string `json:"commission"`
CommissionAsset string `json:"commissionAsset"`
}
// CreateOCOService create order
type CreateOCOService struct {
c *Client
symbol string
listClientOrderID *string
side SideType
quantity *string
limitClientOrderID *string
price *string
limitIcebergQty *string
stopClientOrderID *string
stopPrice *string
stopLimitPrice *string
stopIcebergQty *string
stopLimitTimeInForce *TimeInForceType
newOrderRespType *NewOrderRespType
}
// Symbol set symbol
func (s *CreateOCOService) Symbol(symbol string) *CreateOCOService {
s.symbol = symbol
return s
}
// Side set side
func (s *CreateOCOService) Side(side SideType) *CreateOCOService {
s.side = side
return s
}
// Quantity set quantity
func (s *CreateOCOService) Quantity(quantity string) *CreateOCOService {
s.quantity = &quantity
return s
}
// ListClientOrderID set listClientOrderID
func (s *CreateOCOService) ListClientOrderID(listClientOrderID string) *CreateOCOService {
s.listClientOrderID = &listClientOrderID
return s
}
// LimitClientOrderID set limitClientOrderID
func (s *CreateOCOService) LimitClientOrderID(limitClientOrderID string) *CreateOCOService {
s.limitClientOrderID = &limitClientOrderID
return s
}
// Price set price
func (s *CreateOCOService) Price(price string) *CreateOCOService {
s.price = &price
return s
}
// limitIcebergQuantity set limitIcebergQuantity
func (s *CreateOCOService) limitIcebergQuantity(limitIcebergQty string) *CreateOCOService {
s.limitIcebergQty = &limitIcebergQty
return s
}
// StopClientOrderID set stopClientOrderID
func (s *CreateOCOService) StopClientOrderID(stopClientOrderID string) *CreateOCOService {
s.stopClientOrderID = &stopClientOrderID
return s
}
// StopPrice set stop price
func (s *CreateOCOService) StopPrice(stopPrice string) *CreateOCOService {
s.stopPrice = &stopPrice
return s
}
// StopLimitPrice set stop limit price
func (s *CreateOCOService) StopLimitPrice(stopLimitPrice string) *CreateOCOService {
s.stopLimitPrice = &stopLimitPrice
return s
}
// StopIcebergQty set stop limit price
func (s *CreateOCOService) StopIcebergQty(stopIcebergQty string) *CreateOCOService {
s.stopIcebergQty = &stopIcebergQty
return s
}
// StopLimitTimeInForce set stopLimitTimeInForce
func (s *CreateOCOService) StopLimitTimeInForce(stopLimitTimeInForce TimeInForceType) *CreateOCOService {
s.stopLimitTimeInForce = &stopLimitTimeInForce
return s
}
// NewOrderRespType set icebergQuantity
func (s *CreateOCOService) NewOrderRespType(newOrderRespType NewOrderRespType) *CreateOCOService {
s.newOrderRespType = &newOrderRespType
return s
}
func (s *CreateOCOService) createOrder(ctx context.Context, endpoint string, result interface{},
opts ...common.RequestOption,
) (err error) {
r := common.NewPostRequestSigned(endpoint)
m := common.Params{
"symbol": s.symbol,
"side": s.side,
"quantity": *s.quantity,
"price": *s.price,
"stopPrice": *s.stopPrice,
}
if s.listClientOrderID != nil {
m["listClientOrderId"] = *s.listClientOrderID
}
if s.limitClientOrderID != nil {
m["limitClientOrderId"] = *s.limitClientOrderID
}
if s.limitIcebergQty != nil {
m["limitIcebergQty"] = *s.limitIcebergQty
}
if s.stopClientOrderID != nil {
m["stopClientOrderId"] = *s.stopClientOrderID
}
if s.stopLimitPrice != nil {
m["stopLimitPrice"] = *s.stopLimitPrice
}
if s.stopIcebergQty != nil {
m["stopIcebergQty"] = *s.stopIcebergQty
}
if s.stopLimitTimeInForce != nil {
m["stopLimitTimeInForce"] = *s.stopLimitTimeInForce
}
if s.newOrderRespType != nil {
m["newOrderRespType"] = *s.newOrderRespType
}
r.SetFormParams(m)
if err = s.c.CallAPI(ctx, r, result, opts...); err != nil {
return err
}
return nil
}
// Do send Request
func (s *CreateOCOService) Do(ctx context.Context, opts ...common.RequestOption) (res *CreateOCOResponse, err error) {
res = new(CreateOCOResponse)
if err = s.createOrder(ctx, "/api/v3/order/oco", res, opts...); err != nil {
return nil, err
}
return res, nil
}
// CreateOCOResponse define create order response
type CreateOCOResponse struct {
OrderListID int64 `json:"orderListId"`
ContingencyType string `json:"contingencyType"`
ListStatusType string `json:"listStatusType"`
ListOrderStatus string `json:"listOrderStatus"`
ListClientOrderID string `json:"listClientOrderId"`
TransactionTime int64 `json:"transactionTime"`
Symbol string `json:"symbol"`
Orders []*OCOOrder `json:"orders"`
OrderReports []*OCOOrderReport `json:"orderReports"`
}
// OCOOrder may be returned in an array of OCOOrder in a CreateOCOResponse.
type OCOOrder struct {
Symbol string `json:"symbol"`
OrderID int64 `json:"orderId"`
ClientOrderID string `json:"clientOrderId"`
}
// OCOOrderReport may be returned in an array of OCOOrderReport in a CreateOCOResponse.
type OCOOrderReport struct {
Symbol string `json:"symbol"`
OrderID int64 `json:"orderId"`
OrderListID int64 `json:"orderListId"`
ClientOrderID string `json:"clientOrderId"`
OrigClientOrderID string `json:"origClientOrderId"`
TransactionTime int64 `json:"transactionTime"`
Price string `json:"price"`
OrigQuantity string `json:"origQty"`
ExecutedQuantity string `json:"executedQty"`
CummulativeQuoteQuantity string `json:"cummulativeQuoteQty"`
Status OrderStatusType `json:"status"`
TimeInForce TimeInForceType `json:"timeInForce"`
Type OrderType `json:"type"`
Side SideType `json:"side"`
StopPrice string `json:"stopPrice"`
IcebergQuantity string `json:"icebergQty"`
}
// ListOpenOrdersService list opened orders
type ListOpenOrdersService struct {
c *Client
symbol string
}
// Symbol set symbol
func (s *ListOpenOrdersService) Symbol(symbol string) *ListOpenOrdersService {
s.symbol = symbol
return s
}
// Do send Request
func (s *ListOpenOrdersService) Do(ctx context.Context, opts ...common.RequestOption) (res []*Order, err error) {
r := common.NewGetRequestSigned("/api/v3/openOrders")
if s.symbol != "" {
r.SetQuery("symbol", s.symbol)
}
res = make([]*Order, 0)
if err = s.c.CallAPI(ctx, r, &res, opts...); err != nil {
return nil, err
}
return res, nil
}
// GetOrderService get an order
type GetOrderService struct {
c *Client
symbol string
orderID *int64
origClientOrderID *string
}
// Symbol set symbol
func (s *GetOrderService) Symbol(symbol string) *GetOrderService {
s.symbol = symbol
return s
}
// OrderID set orderID
func (s *GetOrderService) OrderID(orderID int64) *GetOrderService {
s.orderID = &orderID
return s
}
// OrigClientOrderID set origClientOrderID
func (s *GetOrderService) OrigClientOrderID(origClientOrderID string) *GetOrderService {
s.origClientOrderID = &origClientOrderID
return s
}
// Do send Request
func (s *GetOrderService) Do(ctx context.Context, opts ...common.RequestOption) (res *Order, err error) {
r := common.NewGetRequestSigned("/api/v3/order")
r.SetQuery("symbol", s.symbol)
if s.orderID != nil {
r.SetQuery("orderId", *s.orderID)
}
if s.origClientOrderID != nil {
r.SetQuery("origClientOrderId", *s.origClientOrderID)
}
res = new(Order)
if err = s.c.CallAPI(ctx, r, res, opts...); err != nil {
return nil, err
}
return res, nil
}
// Order define order info
type Order struct {
Symbol string `json:"symbol"`
OrderID int64 `json:"orderId"`
ClientOrderID string `json:"clientOrderId"`
Price string `json:"price"`
OrigQuantity string `json:"origQty"`
ExecutedQuantity string `json:"executedQty"`
CummulativeQuoteQuantity string `json:"cummulativeQuoteQty"`
Status OrderStatusType `json:"status"`
TimeInForce TimeInForceType `json:"timeInForce"`
Type OrderType `json:"type"`
Side SideType `json:"side"`
StopPrice string `json:"stopPrice"`
IcebergQuantity string `json:"icebergQty"`
Time int64 `json:"time"`
UpdateTime int64 `json:"updateTime"`
IsWorking bool `json:"isWorking"`
IsIsolated bool `json:"isIsolated"`
}
// ListOrdersService all account orders; active, canceled, or filled
type ListOrdersService struct {
c *Client
symbol string
orderID *int64
startTime *int64
endTime *int64
limit *int
}
// Symbol set symbol
func (s *ListOrdersService) Symbol(symbol string) *ListOrdersService {
s.symbol = symbol
return s
}
// OrderID set orderID
func (s *ListOrdersService) OrderID(orderID int64) *ListOrdersService {
s.orderID = &orderID
return s
}
// StartTime set starttime
func (s *ListOrdersService) StartTime(startTime int64) *ListOrdersService {
s.startTime = &startTime
return s
}
// EndTime set endtime
func (s *ListOrdersService) EndTime(endTime int64) *ListOrdersService {
s.endTime = &endTime
return s
}
// Limit set limit
func (s *ListOrdersService) Limit(limit int) *ListOrdersService {
s.limit = &limit
return s
}
// Do send Request
func (s *ListOrdersService) Do(ctx context.Context, opts ...common.RequestOption) (res []*Order, err error) {
r := common.NewGetRequestSigned("/api/v3/allOrders")
r.SetQuery("symbol", s.symbol)
if s.orderID != nil {
r.SetQuery("orderId", *s.orderID)
}
if s.startTime != nil {
r.SetQuery("startTime", *s.startTime)
}
if s.endTime != nil {
r.SetQuery("endTime", *s.endTime)
}
if s.limit != nil {
r.SetQuery("limit", *s.limit)
}
res = make([]*Order, 0)
if err = s.c.CallAPI(ctx, r, &res, opts...); err != nil {
return nil, err
}
return res, nil
}
// CancelOrderService cancel an order
type CancelOrderService struct {
c *Client
symbol string
orderID *int64
origClientOrderID *string
newClientOrderID *string
}
// Symbol set symbol
func (s *CancelOrderService) Symbol(symbol string) *CancelOrderService {
s.symbol = symbol
return s
}
// OrderID set orderID
func (s *CancelOrderService) OrderID(orderID int64) *CancelOrderService {
s.orderID = &orderID
return s
}
// OrigClientOrderID set origClientOrderID
func (s *CancelOrderService) OrigClientOrderID(origClientOrderID string) *CancelOrderService {
s.origClientOrderID = &origClientOrderID
return s
}
// NewClientOrderID set newClientOrderID
func (s *CancelOrderService) NewClientOrderID(newClientOrderID string) *CancelOrderService {
s.newClientOrderID = &newClientOrderID
return s
}
// Do send Request
func (s *CancelOrderService) Do(ctx context.Context, opts ...common.RequestOption) (res *CancelOrderResponse, err error) {
r := common.NewDeleteRequestSigned("/api/v3/order")
r.SetForm("symbol", s.symbol)
if s.orderID != nil {
r.SetForm("orderId", *s.orderID)
}
if s.origClientOrderID != nil {
r.SetForm("origClientOrderId", *s.origClientOrderID)
}
if s.newClientOrderID != nil {
r.SetForm("newClientOrderId", *s.newClientOrderID)
}
res = new(CancelOrderResponse)
if err = s.c.CallAPI(ctx, r, res, opts...); err != nil {
return nil, err
}
return res, nil
}
// CancelOCOService cancel all active orders on the list order.
type CancelOCOService struct {
c *Client
symbol string
listClientOrderID string
orderListID int64
newClientOrderID string
}
// Symbol set symbol
func (s *CancelOCOService) Symbol(symbol string) *CancelOCOService {
s.symbol = symbol
return s
}
// ListClientOrderID sets listClientOrderId
func (s *CancelOCOService) ListClientOrderID(listClientOrderID string) *CancelOCOService {
s.listClientOrderID = listClientOrderID
return s
}
// OrderListID sets orderListId
func (s *CancelOCOService) OrderListID(orderListID int64) *CancelOCOService {
s.orderListID = orderListID
return s
}
// NewClientOrderID sets newClientOrderId
func (s *CancelOCOService) NewClientOrderID(newClientOrderID string) *CancelOCOService {
s.newClientOrderID = newClientOrderID
return s
}
// Do send Request
func (s *CancelOCOService) Do(ctx context.Context, opts ...common.RequestOption) (res *CancelOCOResponse, err error) {
r := common.NewDeleteRequestSigned("/api/v3/orderList")
r.SetForm("symbol", s.symbol)
if s.listClientOrderID != "" {
r.SetForm("listClientOrderId", s.listClientOrderID)
}
if s.orderListID != 0 {
r.SetForm("orderListId", s.orderListID)
}
if s.newClientOrderID != "" {
r.SetForm("newClientOrderId", s.newClientOrderID)
}
res = new(CancelOCOResponse)
if err = s.c.CallAPI(ctx, r, res, opts...); err != nil {
return nil, err
}
return res, nil
}
// CancelOpenOrdersService cancel all active orders on a symbol.
type CancelOpenOrdersService struct {
c *Client
symbol string
}
// Symbol set symbol
func (s *CancelOpenOrdersService) Symbol(symbol string) *CancelOpenOrdersService {
s.symbol = symbol
return s
}
// Do send Request
func (s *CancelOpenOrdersService) Do(ctx context.Context, opts ...common.RequestOption) (res *CancelOpenOrdersResponse, err error) {
r := common.NewDeleteRequestSigned("/api/v3/openOrders")
r.SetQuery("symbol", s.symbol)
rawMessages := make([]*json.RawMessage, 0)
if err = s.c.CallAPI(ctx, r, &rawMessages, opts...); err != nil {
return &CancelOpenOrdersResponse{}, err
}
cancelOpenOrdersResponse := new(CancelOpenOrdersResponse)
for _, j := range rawMessages {
o := new(CancelOrderResponse)
if err := json.Unmarshal(*j, o); err != nil {
return &CancelOpenOrdersResponse{}, err
}
// Non-OCO orders guaranteed to have order list ID of -1
if o.OrderListID == -1 {
cancelOpenOrdersResponse.Orders = append(cancelOpenOrdersResponse.Orders, o)
continue
}
oco := new(CancelOCOResponse)
if err := json.Unmarshal(*j, oco); err != nil {
return &CancelOpenOrdersResponse{}, err
}
cancelOpenOrdersResponse.OCOOrders = append(cancelOpenOrdersResponse.OCOOrders, oco)
}
return cancelOpenOrdersResponse, nil
}
// CancelOpenOrdersResponse defines cancel open orders response.
type CancelOpenOrdersResponse struct {
Orders []*CancelOrderResponse
OCOOrders []*CancelOCOResponse
}
// CancelOrderResponse may be returned included in a CancelOpenOrdersResponse.
type CancelOrderResponse struct {
Symbol string `json:"symbol"`
OrigClientOrderID string `json:"origClientOrderId"`
OrderID int64 `json:"orderId"`
OrderListID int64 `json:"orderListId"`
ClientOrderID string `json:"clientOrderId"`
TransactTime int64 `json:"transactTime"`
Price string `json:"price"`
OrigQuantity string `json:"origQty"`
ExecutedQuantity string `json:"executedQty"`
CummulativeQuoteQuantity string `json:"cummulativeQuoteQty"`
Status OrderStatusType `json:"status"`
TimeInForce TimeInForceType `json:"timeInForce"`
Type OrderType `json:"type"`
Side SideType `json:"side"`
}
// CancelOCOResponse may be returned included in a CancelOpenOrdersResponse.
type CancelOCOResponse struct {
OrderListID int64 `json:"orderListId"`
ContingencyType string `json:"contingencyType"`
ListStatusType string `json:"listStatusType"`
ListOrderStatus string `json:"listOrderStatus"`
ListClientOrderID string `json:"listClientOrderId"`
TransactionTime int64 `json:"transactionTime"`
Symbol string `json:"symbol"`
Orders []*OCOOrder `json:"orders"`
OrderReports []*OCOOrderReport `json:"orderReports"`
}