From fce3beccd08d49a5c17f3a01b2df044938db283f Mon Sep 17 00:00:00 2001 From: c9s Date: Tue, 9 Jun 2020 23:27:46 +0800 Subject: [PATCH] refactor pnl updater --- bbgo/parser.go | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/bbgo/parser.go b/bbgo/parser.go index 5e409dc8d..0687e0a8e 100644 --- a/bbgo/parser.go +++ b/bbgo/parser.go @@ -54,15 +54,24 @@ type ExecutionReportEvent struct { OrderType string `json:"o"` TimeInForce string `json:"f"` - Quantity string `json:"q"` - Price string `json:"p"` - StopPrice string `json:"P"` + OrderQuantity string `json:"q"` + OrderPrice string `json:"p"` + StopPrice string `json:"P"` + + IsOnBook bool `json:"w"` + IsMaker bool `json:"m"` + + CommissionAmount string `json:"n"` + CommissionAsset string `json:"N"` CurrentExecutionType string `json:"x"` CurrentOrderStatus string `json:"X"` OrderID int `json:"i"` + TradeID int64 `json:"t"` + TransactionTime int64 `json:"T"` + LastExecutedQuantity string `json:"l"` CumulativeFilledQuantity string `json:"z"` LastExecutedPrice string `json:"L"` @@ -193,4 +202,3 @@ func ParseEvent(message string) (interface{}, error) { return nil, fmt.Errorf("unsupported message: %s", message) } -