File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
src/ExchangeSharp/API/Exchanges/KuCoin Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -863,6 +863,11 @@ private ExchangeOrderResult ParseOpenOrder(JToken token)
863
863
. DateTime
864
864
} ;
865
865
866
+ if ( order . AveragePrice == 0 )
867
+ {
868
+ order . AveragePrice = token [ "dealFunds" ] . ConvertInvariant < decimal > ( ) / token [ "dealSize" ] . ConvertInvariant < decimal > ( ) ;
869
+ }
870
+
866
871
// Amount and Filled are returned as Sold and Pending, so we'll adjust
867
872
order . AmountFilled = token [ "dealSize" ] . ConvertInvariant < decimal > ( ) ;
868
873
order . Amount = token [ "size" ] . ConvertInvariant < decimal > ( ) + order . AmountFilled . Value ;
@@ -895,6 +900,12 @@ private ExchangeOrderResult ParseCompletedOrder(JToken token)
895
900
. FromUnixTimeMilliseconds ( token [ "createdAt" ] . ConvertInvariant < long > ( ) )
896
901
. DateTime
897
902
} ;
903
+
904
+ if ( order . AveragePrice == 0 )
905
+ {
906
+ order . AveragePrice = token [ "dealFunds" ] . ConvertInvariant < decimal > ( ) / token [ "dealSize" ] . ConvertInvariant < decimal > ( ) ;
907
+ }
908
+
898
909
if ( token [ "cancelExist" ] . ToStringInvariant ( ) . ToUpper ( ) == "TRUE" )
899
910
{
900
911
order . Result = ExchangeAPIOrderResult . Canceled ;
@@ -903,6 +914,7 @@ private ExchangeOrderResult ParseCompletedOrder(JToken token)
903
914
{
904
915
order . Result = ExchangeAPIOrderResult . Filled ;
905
916
}
917
+
906
918
return order ;
907
919
}
908
920
You can’t perform that action at this time.
0 commit comments