@@ -26,6 +26,19 @@ func (c *grpcClient) SendOrderStatus(so sessionOrder) {
2626 rpt .Symbol = so .order .Symbol ()
2727 rpt .ExOrdId = so .order .ExchangeId
2828 rpt .ReportType = protocol .ExecutionReport_Status
29+ switch so .order .OrderState {
30+ case New , Booked :
31+ rpt .OrderState = protocol .ExecutionReport_Booked
32+ case PartialFill :
33+ rpt .OrderState = protocol .ExecutionReport_Partial
34+ case Filled :
35+ rpt .OrderState = protocol .ExecutionReport_Filled
36+ case Cancelled :
37+ rpt .OrderState = protocol .ExecutionReport_Cancelled
38+ case Rejected :
39+ rpt .OrderState = protocol .ExecutionReport_Rejected
40+ }
41+ rpt .RejectReason = so .order .RejectReason
2942 rpt .ClOrdId = int32 (so .order .Id )
3043 rpt .Quantity = ToFloat (so .order .Quantity )
3144 rpt .Price = ToFloat (so .order .Price )
@@ -69,6 +82,23 @@ func (c *grpcClient) sendTradeExecutionReport(so sessionOrder, price Fixed, quan
6982 } else {
7083 rpt .Side = protocol .CreateOrderRequest_Sell
7184 }
85+ switch so .order .OrderState {
86+ case New , Booked :
87+ rpt .OrderState = protocol .ExecutionReport_Booked
88+ case PartialFill :
89+ rpt .OrderState = protocol .ExecutionReport_Partial
90+ case Filled :
91+ rpt .OrderState = protocol .ExecutionReport_Filled
92+ case Cancelled :
93+ rpt .OrderState = protocol .ExecutionReport_Cancelled
94+ case Rejected :
95+ rpt .OrderState = protocol .ExecutionReport_Rejected
96+ }
97+
98+ if ! remaining .Equal (ZERO ) {
99+ rpt .OrderState = protocol .ExecutionReport_Partial
100+ }
101+
72102 rpt .Remaining = ToFloat (remaining )
73103 reply := & protocol.OutMessage_Execrpt {Execrpt : rpt }
74104 so .client .(* grpcClient ).conn .Send (& protocol.OutMessage {Reply : reply })
0 commit comments