From 573d0788ab20320e4b232f0e9368269955d10acb Mon Sep 17 00:00:00 2001 From: "l.tingting" Date: Tue, 12 Dec 2023 00:18:17 +0800 Subject: [PATCH] fix: extract account info in binance derivatives error --- ..._execution_management_service_binance_derivatives_base.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/include/ccapi_cpp/service/ccapi_execution_management_service_binance_derivatives_base.h b/include/ccapi_cpp/service/ccapi_execution_management_service_binance_derivatives_base.h index e0a62e98..7fba68b2 100644 --- a/include/ccapi_cpp/service/ccapi_execution_management_service_binance_derivatives_base.h +++ b/include/ccapi_cpp/service/ccapi_execution_management_service_binance_derivatives_base.h @@ -45,7 +45,11 @@ class ExecutionManagementServiceBinanceDerivativesBase : public ExecutionManagem element.insert(CCAPI_EM_POSITION_QUANTITY, positionAmt); element.insert(CCAPI_EM_POSITION_ENTRY_PRICE, x["entryPrice"].GetString()); element.insert(CCAPI_EM_POSITION_LEVERAGE, x["leverage"].GetString()); - element.insert(CCAPI_EM_UNREALIZED_PNL, x["unrealizedProfit"].GetString()); + if (x.HasMember("unrealizedProfit")) { + element.insert(CCAPI_EM_UNREALIZED_PNL, x["unrealizedProfit"].GetString()); + } else { + element.insert(CCAPI_EM_UNREALIZED_PNL, x["unRealizedProfit"].GetString()); + } element.insert(CCAPI_LAST_UPDATED_TIME_SECONDS, UtilTime::convertMillisecondsStrToSecondsStr(x["updateTime"].GetString())); elementList.emplace_back(std::move(element)); }