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)
863863 . DateTime
864864 } ;
865865
866+ if ( order . AveragePrice == 0 )
867+ {
868+ order . AveragePrice = token [ "dealFunds" ] . ConvertInvariant < decimal > ( ) / token [ "dealSize" ] . ConvertInvariant < decimal > ( ) ;
869+ }
870+
866871 // Amount and Filled are returned as Sold and Pending, so we'll adjust
867872 order . AmountFilled = token [ "dealSize" ] . ConvertInvariant < decimal > ( ) ;
868873 order . Amount = token [ "size" ] . ConvertInvariant < decimal > ( ) + order . AmountFilled . Value ;
@@ -895,6 +900,12 @@ private ExchangeOrderResult ParseCompletedOrder(JToken token)
895900 . FromUnixTimeMilliseconds ( token [ "createdAt" ] . ConvertInvariant < long > ( ) )
896901 . DateTime
897902 } ;
903+
904+ if ( order . AveragePrice == 0 )
905+ {
906+ order . AveragePrice = token [ "dealFunds" ] . ConvertInvariant < decimal > ( ) / token [ "dealSize" ] . ConvertInvariant < decimal > ( ) ;
907+ }
908+
898909 if ( token [ "cancelExist" ] . ToStringInvariant ( ) . ToUpper ( ) == "TRUE" )
899910 {
900911 order . Result = ExchangeAPIOrderResult . Canceled ;
@@ -903,6 +914,7 @@ private ExchangeOrderResult ParseCompletedOrder(JToken token)
903914 {
904915 order . Result = ExchangeAPIOrderResult . Filled ;
905916 }
917+
906918 return order ;
907919 }
908920
You can’t perform that action at this time.
0 commit comments